cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to fetch access and refresh token Rest receiver adapter

udayabhaskar
Explorer
0 Kudos

My scenario:

SAP <-> Proxy (SOAP sender adapter) <-> PO <-> Rest adapter (receiver) <-> 3rd party system

Initially a synchronous scenario interface is initiated from SAP which will hit the 3rd party system from PI through the Rest receiver channel which will send an access token and refresh token. I am receiving the access and refresh token in this procedure. Then another refresh token interface will be initiated from SAP which will keep the access token alive as it expires in a specific time. The refresh token is being triggered automatically by a background job from SAP every 1 hour. But the problem is every time the refresh token job runs it is getting a new refresh token and access token.

I need to use this access token in few other interfaces and perform synchronous scenarios all of which are initiated from SAP.

I am a little confused on how exactly I can proceed with this scenario. Mine is a Rest POST method. I cannot use a GET method over here.

I have followed the steps in the below links but still getting the same error: MP: exception caught with cause java.lang.RuntimeException: HTTP Communication Error. Could not retrieve oAuth Token.

https://blogs.sap.com/2019/04/25/fetch-oauth-token-in-rest-is-now-out-of-the-box/

I do not have the client key and auth chain so I could not follow the below link steps properly:

https://blogs.sap.com/2020/02/29/oauth-2.0-standard-solution-with-grant-type-as-password-in-sap-po-7...

Till now I have not tried the UDF related part which I am unable to clearly understand.

Please help me out with a easier procedure and if possible with step wise procedure in an as much easy way as possible so that I can complete my work asap as I am in a deadline and need to complete this.

Accepted Solutions (0)

Answers (0)