Skip to Content

How to use OAuth option in SAP PO 7.5

Hello Experts,

I need help to configure below scenario in SAP PO 7.5 system.
I want to establish connection with AWS server based API's using REST adapter provided by SAP.

This is 2 step method

1 - Call token URL by giving specific(fix) header
this URL will return token number and expiry time like below

{

"access_token": "eyJraWQiOiJpen..........",
"expires_in": 3600,
"token_type": "Bearer"

}

2 -Call API to post main JSON payload with access token as header received from token API.

I have currently configured REST receiver channel as below.

My question is how caching worked and how to use token which is received by token API.

Regards,
Chetan Risbud

capture1.png (28.9 kB)
capture2.png (8.8 kB)
capture3.png (11.0 kB)
capture4.png (4.0 kB)
capture5.png (8.9 kB)
capture6.png (5.4 kB)
capture7.png (3.0 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Oct 30, 2019 at 01:50 PM

    Hi!

    HTTP header in the format "Authorization: Bearer <access_token>" is added by adapter itself to the request headers.

    Token caching is also provided by adapter using parameter "expires_in" which is returned by authorization server.

    Regards, Evgeniy.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi!

      You might refer to the SAP Note: 2405166 - New Feature: Support for OAuth 2.0 Client Credentials and Resource Owner Password Credentials Grants for better undersatnding the process of getting access token.

      This note, in turn, refers to RFC6749 and RFC6750 specifications where the rules of retrieving and further using of access token are defined:

      1. You can choose from the following grant flows:
      2. You can configure how to use the received access token as defined in https://tools.ietf.org/html/rfc6750. Select followig values for the field "Use credentials and Oauth 2.0 access token as" :
        • HTTP Header - adds the access token to the request HTTP headers in the following format "Authorization: Bearer <access_token>"
        • Query Parameter - adds the access token to the resource URL in following format: http://<host>:<port>/<resource_path>?access_token=<access_token_value>
        • Important Note: Sending access token as "Form-Encoded Body Parameter" is not supported!

      At the first sight I couldn't see the way to use retrieved access token outside the internal OAuth authorization process flow implemented in REST adapter (strictly according to specifications mentioned above), unless its value is stored to some dynamic REST attribute, which could be used in HTTP header value pattern.

      Regards, Evgeniy.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.