cancel
Showing results for 
Search instead for 
Did you mean: 

Getting 500 Error when trying to consume SAP BTP Destination

Raghu_150
Explorer
0 Kudos

Dear ,

I am getting an Internal Server Error when trying to consume a SAP BTP Destination service in SAPUI5 application in my trial account.

Raghu_150_0-1707666556419.png

Below is the destination one.

Raghu_150_1-1707666652242.png

and the service is returning 200 OK when checking the connection.

Raghu_150_2-1707666708626.png

Please help me ..

Accepted Solutions (0)

Answers (1)

Answers (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @Raghu_150,

Do you have any roles defined for the service in question? It might be the case that you are able to connect to the service, but when your service checks for a valid user it doesn't get it. This is due to the fact the Client Credentials flow doesn't carry a real user that you can assign role to it. Instead, this is going to give you a platform/technical user - for which you cannot assign any roles. Therefore, the system may throw you a 500 error when it tries to check for authorizations. 

Client Credentials OAuth2 Flow is for API usage - not suited to propagate users between Front-End and backing services. For that scenario, you should consider the OAuth2JWTBearer which will propagate the user obtained by the Front-End (usually SAP AppRouter) to your service defined in CAP. Keep in mind that this will be tue only if you are on the same subaccount. If you are crossing the subaccount boundaries, you will have to rely on the OAth2SAMLBearer authentication flow - just as long as both subaccounts have the same IdP registered. 

Best regards,
Ivan