cancel
Showing results for 
Search instead for 
Did you mean: 

OAuth 2.0 Authentication for REST Sender adapter

0 Kudos

Hi Experts,

I am trying to make REST sender adapter work with OAuth 2.0 authentication

I configured REST adapter to use OAuth2LoginModule (a global configuration)

Also I successfully generate a token with grant_type=client_credentials

Now when I try to authenticate with the token against REST sender channel I get below error

com.sap.security.oauth2.exception.OAuthPersistenceRuntimeException: Failed to convert AccessToken to AccessTokenDBIdInfo, the user grant from the data base is null.

Interesting is that for tokens generated with grant_type=authorization_code the REST sender adapter is called successfully

I also noticed in UME_OA_GRANT table that tokens created with grant_type=authorization_code are granted to a PI user. And tokens created with grant_type=client_credentials do not have such grant

However what is not clear - how to grant a token created with grant_type=client_credentials to a PI user?


Kind Regards,

Accepted Solutions (0)

Answers (2)

Answers (2)

YasanthaJ
Discoverer
0 Kudos

Hi Tchalkov,

Where you able to get this working somehow?

After setting up the OAuth client (through oauth/admin, as in the screenshot), when I call the oauth/token endpoint from postman, it returns a Bearer token with expiration set to 1 hour.

But I don’t see the token is issue appearing in the OAuth Tokens page.

Wonder if I’m missing something here. Actually other than setting up the OAuth client anything else has to be done here? Do I need to define the scope as well? Anything in the UME like?

Any help would be appreciated.

~ Jay


former_member413548
Discoverer
0 Kudos

Hi Tchalkov,

I am also trying for REST sender adapter work with OAuth 2.0 authentication. However would like to know what are the pre-requisites to setup on SAP PO system before we use module OAuth2LoginModule in the channel. Is it as mentioned below?

https://help.sap.com/viewer/88b4a541f23c4153bfa26e2c6b698b67/7.5.7/en-US/9f45051ab0b740cb8f7ebc446d3...

Regards,

Bharat Paliwal

former_member198879
Discoverer
0 Kudos

Hi Bharat,

Were you able to achieve this? AS I am also having a similar requirement like this.

If yes please let me know how to achieved it?