cancel
Showing results for 
Search instead for 
Did you mean: 

Get logged in user info in Cloud Foundry

arjun_thakur
Active Contributor

Hi Experts,

I am working a SAPUI5 application in SAP Cloud Foundry. I have a requirement to get the logged in user details such as email id, name etc in the application. I am trying to follow the steps which robiocko described in the following blog:

https://blogs.sap.com/2019/05/23/how-to-get-the-email-of-the-logged-in-user-in-cloud-foundry/

Here is what all i had done:

1) Created an instance of XSUAA service in CF

2) in Postman, I called the following URL to get the access token:

https://accountName.authentication.us10.hana.ondemand.com/oauth/token?grant_type=client_credentials

3) After getting the access token, in postman, i am calling following service with being passed in header access token:

https://api.authentication.us10.hana.ondemand.com/userinfo

i am getting the error: "The subdomain does not map to a valid identity zone"

but i am able to call other UAA services successfully such as:

https://api.authentication.us20.hana.ondemand.com/Users (With this i get the list of all the users. But i need the details of Logged in user only)

Can anyone please advise how can i solve the issue for the userinfo service

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member194549
Contributor
0 Kudos

Hi,

you can create a endpoint in your backend service in which you can decode the JWT via the SAP Cloud SDK and return the user informations of the JWT in this endpoint.

See also Wouter's Blog.

Regards
Simon