Skip to Content

Get logged in user info in Cloud Foundry

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 Robert Ocko 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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Aug 05, 2020 at 02:08 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.