cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP JAVA accessing business rules destination is giving bad credentials error

sk_ramkumar
Participant
0 Kudos

Hi Experts,

I am trying to access Business rule destination defined in BTP through DestinationAccessor but it is giving below error,

"Failed to read authentication token of destination 'BUSINESS_RULES_BPA'. The destination service responded with an error: 'Bad credentials'.

 

This is my code to access the destination,

DestinationAccessor.getDestination("BUSINESS_RULES_BPA").asHttp()

Screenshot 2024-02-01 at 11.00.56 am.png

The same client secret and password is working fine in Postman.

Thanks in advance.

Ramkumar

View Entire Topic
newtork
Advisor
Advisor
0 Kudos

I'm a developer from the SAP Cloud SDK team.

The error message "The destination service responded with an error: 'Bad credentials'" indicates that the BTP Destination Service was unable to resolve an access token with the OAuth2 Client Credentials grant. That means the request you ran with Postman does not work for the service respectively.

SAP Cloud SDK is not performing the token exchange/retrieval operation. Instead it fully relies on BTP Destination Service. However the SDK caches the service response for a few minutes.

Does the problem persist? If yes, then I would rather recommend approaching the BTP Destination Service colleagues.