
app.get("/whoAmI", (req, res) => {
var userContext = req.authInfo;
var result = JSON.stringify({
userContext: userContext
});
res.type("application/json").status(200).send(result);
});
app.get("/userinfo", function (req, res) {
let userInfo = {
"name": req.user.id,
"familyName": req.user.name.familyName,
"emails": req.user.emails,
"scopes": req.authInfo.scopes,
"identity-zone": req.authInfo.identityZone
};
return res.type("application/json").status(200).json(userInfo);
}); var body = "";
body = JSON.stringify({
"session" : [{
"UserName": $.session.user,
"UserInfo": $.session.securityContext.userInfo,
"Scopes": $.session.securityContext.scopes,
"Language": $.session.language
}]
});
$.response.contentType = "application/json";
$.response.setBody(JSON.parse(body));
$.response.status = $.net.http.OK;
Click on “Send”. You will receive the access code:
Perform a GET call. The result from the API call is shown below. The scopes shows the list of roles assigned to the user:
The result from the REST Client:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 3143 | |
| 1916 | |
| 1916 | |
| 1213 | |
| 1079 | |
| 757 | |
| 755 | |
| 742 |