on 10-24-2018 5:08 PM
Hi experts,
I need to create a widget that displays the logged user’s attributes (not only ID, e-mail, ..), and add it in a cloud portal site. I managed to create such application in the SAP Web IDE following this post https://blogs.sap.com/2015/04/16/using-the-hcp-user-api-in-web-ide/ and this documentation https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/1de599bf722446849d2b2e10132....
From the web IDE I can reach the url: https://webidecp-xxxxxxxxxx.dispatcher.hana.ondemand.com/services/userapi/attributes and retrieve all the attributes I have set.
From the portal I get an error 404 not found: https://flpnwc-xxxxxxxxxx.dispatcher.hana.ondemand.com/services/userapi/attributes.
I guess I need to change some configuration in the files neo-app.json or manifest.json, does anybody have any suggestion on how to do that?
Thanks in advance,
Chiara
Hi Chiara,
When running in a portal site or launchpad, you can use the Shell UserInfo service to get the logged in user properties:
var UserInfo = sap.ushell.Container.getService("UserInfo");
var user = UserInfo.getUser();
user.getEmail();
user.getId();
user.getFullName();
....
Otherwise for using the platforms User API you would need to "reroute" it when running in a portal widget like any other API call. For more information take a look at my reply on this thread.
Regards, Ido
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.