SAP Knowledge Base Article - Preview

3782324 - SAP PO 7.5 REST Receiver Adapter OAuth 2.0 authentication fails when connecting to SAP BTP IS

Symptom

The SAP PO REST Receiver Adapter is configured to communicate with SAP BTP Integration Suite using OAuth 2.0 authentication. However, message processing fails, and the following error is observed in the message logs:
Calling server: POST <REST_RESOURCE_ENDPOINT>
MP: exception caught with cause java.lang.RuntimeException: HTTP Communication Error. Could not retrieve oAuth Token.

Exception caught by adapter framework: HTTP Communication Error. Could not retrieve oAuth Token.
Transmitting the message to endpoint <local> using connection AFW failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.lang.RuntimeException: HTTP Communication Error. Could not retrieve oAuth Token.
Message status set to NDLV

On collecting TSHW traces for the REST Adapter, as described in 1514898 - Troubleshooting SAP Process Orchestration / Integration, it was observed that the OAuth token response received from the SAP BTP Integration Suite contains the token_type value BearerToken:

received response:{
  "refresh_token_expires_in" : "0",
  (..)
  "token_type" : "BearerToken",
  "issued_at" : "1783498720146",
  (..)
  "scope" : "",
  "expires_in" : "1799",
  "refresh_count" : "0",
  "status" : "approved"
}

Subsequently, the REST Adapter fails during OAuth token processing and reports the following exception:

Current OAuth 2.0 implementation supports only Bearer token type(provided BearerToken)
Catching java.io.IOException: Token type BearerToken is not supported!

However the OAuth configuration works successfully from third party tools like Postman to SAP BTP Integration Suite using the same Token URL, Client ID, Client Secret, and API endpoint. 


Read more...

Environment

SAP Process Integration 7.31 SP017 onwards
SAP Process Integration 7.40 SP013 onwards
SAP Process Integration/Orchestration 7.5 SP001 onwards

Product

SAP ERP 6.0

Keywords

REST, OAuth, reciever, adapter, token_type, BearerToken, netweaver, BTP,Suite , SAP BTP Integration Suite, , KBA , BC-XI-CON-RST , Rest Adapter , LOD-HCI-PI-OPS , Cloud Operations , LOD-HCI-PI-RT , Integration Runtime , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.