SAP Knowledge Base Article - Preview

3152432 - OAuth2 Cleint Credentials authentication fails with HTTP 422 - Bad Request

Symptom

  • In a custom IFlow in your CPI tenant, a HTTP receiver channel is configured with OAuth2 Client Credentials authentication.
  • The messages are failing with HTTP 422 - Bad Request.
  • In the traces, you see the following error:

    java.lang.IllegalArgumentException: Status code:422; Reason:{"code":422,"message":"Bad Request"}
    at com.sap.it.rt.adapter.odata.oauth.OAuthTokenProducer.getOAuthAccessToken(OAuthTokenProducer.java:69)
    at com.sap.it.rt.adapter.odata.oauth.cache.provider.ClientCredentialsTokenProvider.getOauthResponse(ClientCredentialsTokenProvider.java:47)
    at com.sap.it.rt.oauth.cache.handler.impl.OAuthCacheImpl.getOAuthResponse(OAuthCacheImpl.java:119)
    at com.sap.it.rt.oauth.cache.handler.impl.OAuthCacheImpl$1.load(OAuthCacheImpl.java:43)
    ...

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.


Read more...

Environment

  • Cloud Integration
  • SAP Integration Suite

Product

Cloud Integration all versions ; SAP Integration Suite all versions

Keywords

Cloud Integration, CPI, Cloud Platform Integration, HCI, HTTP, OAuth2, 422, Bad Request , KBA , LOD-HCI-PI-CON-HTP , HTTP Adapter , 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.