Skip to Content
0
Dec 06, 2022 at 01:23 PM

OAuth2 - invalid request - due to missing parameter/wrong value

293 Views

Hi,

I'm trying to implement an OAuth2 service which will allow to read data from an external application.

This works as expected via another tool like Postman. Also the google caledar OAuth2 service was implemented in SAP as a test.

However, the OAuth2 service that I need, fails. I succeed in retrieving the code, but when using the code to get the token, an "invalid request" error is generated.


The follwing is the result from a working call in Postman. ( The yellow arrow to indicate that in the next screenshot, there is a dfference )

image.png

I was able to reproduce the same (I hope) error in Postman by changing the Client Authentication from "Send client credential in body" to "send as Basic Auth Header.

image.png

Which resulted in the error - invalid request

image.png

In SAP - I've tried to change the settings in OA2C_CONFIG, but no succes.

image.png

Already did some debug, checked HttpWatch traces, implemented a whole series of notes, read info like

https://help.sap.com/docs/ABAP_PLATFORM/e815bb97839a4d83be6c4fca48ee5777/7573ffc0ae444443a23b9e661d77d637.html?locale=en-US

https://launchpad.support.sap.com/#/notes/1688545 containing

image.png

It is the above that makes me believe that the auth method that is provided in SAP is incorrect and generates the issue as is simulated in Postman.

However I can't find the setting/ change so that the client_secret becomes a body parameter and the basic auth component is removed form the http request header.

Does anyone have an idea as to where I can continue searching?

Thanks

Attachments

image.png (104.1 kB)
image.png (93.3 kB)
image.png (15.9 kB)
image.png (81.5 kB)
image.png (34.2 kB)