cancel
Showing results for 
Search instead for 
Did you mean: 

Cap app - accessing endpoint using destination giving unauthorized(Oauth2clientcredentials)

deepak_h3
Participant
0 Kudos

Trying to call a URL using destination. It is setup as OAuth2ClientCredentials with token url, client id and client secret.

deepak_h3_1-1707311661830.png

It works from postman and also from test.http by getting bearer token.

But if called from BTP destination in CAP app - it does'nt work. It is returning - Unauthorized when run in debug or from terminal.

 

Accepted Solutions (0)

Answers (1)

Answers (1)

MioYasutake
Active Contributor

If you try to connect to the remote service from developing environment, you need to bind to xsuaa and destination services as described in the document below:

https://cap.cloud.sap/docs/guides/using-services#bind-to-remote-destinations

deepak_h3
Participant
0 Kudos
Bind is already done and the destination is loaded also.