cancel
Showing results for 
Search instead for 
Did you mean: 

Unauthorized: Bad credentials error while accessing Springboot app running on SAP Cloud Foundry

0 Kudos

I am getting below error while trying to use sapjco3 in my Springboot application. I am deploying my application to SAP Cloud foundry environment packaging as war file with tomee7 TARGET_RUNTIME.

I am trying to call a BAPI using SAP Cloud SDK as specified in the below documents.

https://sap.github.io/cloud-sdk/docs/java/features/bapi-and-rfc/overview

https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/on-premise-develop-sample-web-applica...

com.sap.cloud.sdk.cloudplatform.security.exception.TokenRequestFailedException: Failed to resolve access token.","\tat com.sap.cloud.sdk.cloudplatform.connectivity.OAuth2ServiceImpl.lambda$executeClientCredentialsFlow$1(OAuth2ServiceImpl.java:119)"

mkuhr-test
Advisor
Advisor
0 Kudos

Linking to the Stackoverflow answer for reference.

Accepted Solutions (0)

Answers (1)

Answers (1)

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert
0 Kudos

That has nothing to do with JCo. The end user fails to log in to the CF application (via HTTP). So the application (which would then use JCo) is not yet even started.

You need to double-check the authentication settings of your CF application.