on 2022 Jun 28 9:50 AM
Hi,
I have created a Freestyle SAP UI5 application for a custom requirement. We will be using SAP IAS for SSO to the application. We would like to get the logged in user information in the app. I am trying with the following Approach. They are not working.
if (window.sap && window.sap.ushell && window.sap.ushell.Container && window.sap.ushell.Container.getUser()) {
loggedInUser = window.sap.ushell.Container.getUser().getId().toUpperCase();
console.log(loggedInUser);
}
if(sap & sap.ushell && sap.ushell.services && sap.ushell.services.UserInfo) {
console.log(sap.ushell.services.UserInfo());
}
if(sap & sap.ushell && sap.ushell.Container) {
console.log(sap.ushell.Container.getServiceAsync("UserInfo"));
}
None of the above code snippets are working. Please advise if there are any other options to get the logged in User details in the SAP Ui5 application. Let me know if any additional information is needed.
Best Regards
Ramana Reddy
You may use User API Service in Cloud Foundry. This blog gives an example how to use it thru SAP AppRouter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marian,
I am looking primarily for Email Address of the logged in user.
Best Regards
Ramana Reddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.