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

How to Fetch Logged-In User Details Using SAP User API in Cloud Foundry?

sivasainathreddy
Discoverer
0 Kudos
455

Hi Community! 

I'm currently working on an SAP project deployed in Cloud Foundry, and I'm trying to fetch the logged-in user's details using the User API. My setup includes an xs-app.json with a route to /userapi/currentUser.

Here's what I'm trying to achieve:
Retrieve the user's full name and user ID.

View Entire Topic
WouterLemaire
SAP Mentor
SAP Mentor
0 Kudos

Normally those fields are available in that api: https://help.sap.com/docs/cloud-portal-service/sap-cloud-portal-service-on-cloud-foundry/user-api-se...

userid depends on how the authentication is configured. Name contains the subject name identifier and in most cases this is the userid but not always. You have some other options like reading the jwt token using cap or reading cis: https://community.sap.com/t5/technology-blogs-by-members/show-current-user-details-in-cloud-foundry-...