Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

preemptive authentication CL_HTTP_CLIENT

ADO
Explorer
0 Likes
2,143

Hello

I have implemented a program to call a REST API. Inside the program I use the classes CL_HTTP_CLIENT to manage the connection. There is no SOAP connection or WebService. It's a direct call from ABAP.
During my tests I get an error like "403 Auth failed: No Authorization header"

The provider of the REST API told me to change preemptive authentication.

My problem is that I do not know how to change this.

Any idea?

Thanks

3 REPLIES 3
Read only

ec1
Active Participant
0 Likes
1,663

Hi Arnfried,

You need to set the authentication data by either calling authenticate method or set the data in SM59 destination

https://help.sap.com/erp_hcm_ias2_2014_03/helpdata/en/b2/86b4512ea4414fb36f17b0568a86ac/content.htm?...

Stev

Read only

1,663

Hello Arnfried,

I had the same problem, SM59 did solve it, it was not possible to set the preemptive parameter in the authenticate method, I had to create an SM59-entry (you can send the path for your request with

CL_HTTP_UTILITY=>SET_REQUEST_URI).

A nice weekend to you

Sibylle

Read only

0 Likes
1,663

Hi, I think I have a similar problem to this question, but my SM59 the Preemptive parameter does not exists (probably an old SAP_BASIS release).

Would be possible for you attach a screenshot on your answer showing that parameter in configuration screen and also your SAP_BASIS version? I want to confirm that I haven't missing it onscreen, but it would also help anyone to identify if their system version has it or not.

Thanks