I am building a HTML5 application in SCP, using Portal Service to manage roles. Back-end developer asked me to give them role info (ID or e-mail) as an input of an interface (They need this authentication info). How to get it?
Is there any front-end API provided to get these info?
User API provides few details about user in HCP.
To use the user API in your HTML5 application, add a route to your neo-app.jso
n application descriptor file as follows:
"routes": [
{
"path": "/services/userapi", //application path to be forwarded
"target": {
"type": "service",
"name": "userapi"
}
}
]
A sample URL for the route defined above would look like this: /services/userapi/currentUser
.
An example response could return the following user data:
{
"name": "p12345678",
"firstName": "Jon",
"lastName": "Snow",
"email": "jon.snow@tina.com",
"displayName": "Jon Snow (p12345678)"
}