cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Build Apps Access User Identity Token

tokgozatakan
Participant
0 Kudos
674

I have a Build Apps application where I need to send a data to a BTP Destination, which is a Kyma Serverless function. I am not able to perform the actions I want in build apps, so I need to process the sent data in kyma, then return the response.

In the Kyma Serverless function, I need to call the destination (which is Sales and Service Cloud Version 2) via destination configuration API, to get the OAuth SAML Bearer token of the relevant services. Normally this would be possible by placing X-user-token to header. 

Build Apps automatically authenticates the user with the standard function flow, and I am able to access the mentioned Sales and Service Cloud Version 2 destination. My question is, how I can also pass this user token to my custom function?

 

Note: I am also open to any other suggestion, as long as the user is able get authenticated. 

View Entire Topic
Dan_Wroblewski
Developer Advocate
Developer Advocate

I'm not really an expert here, but when the backend needs to know the user, we usually use a destination with UserTokenExchange, and the current BTP user is sent so as long as the backend accepts the BTP user all is fine.

Or are you making a separate request to get the user token?

tokgozatakan
Participant
0 Kudos

Hello Dan, 

Indeed, creating an OAuth2UserTokenExchange with the token link to our IAS worked. Kyma now receives the relevant JWT token as the authorization header. 

2024-09-02_15h53_01.png