
Authorization Management API is used to manage roles and groups and their assignments in applications. With Authorization Management API we can also assign the roles or group to user as per customer requirement.
The Authorization Management API is protected with OAuth 2.0 client credentials. Create an OAuth client and obtain an access token to call the API methods.
var access_token_url = "/<Destination name with authorization i.e. c4c_oauth> /oauth2/apitoken/v1?grant_type=client_credentials";
//************* AJAX Call Start *************//
$.ajax({
type: "POST",
contentType: "application/json",
url: access_token_url,
success: function(data, textStatus, jqXHR) {
var acc_token = data.access_token;
var header_token = "Bearer" + " " + acc_token;
var get_role_url = /<Second Destination with authorization NoAuthentication > /authorization/v1/accounts/<Subaccount Name> /users/roles/?userId=" +<Pass the userID>;
$.ajax({
type: "GET",
contentType: "application/json",
accept: "application/json",
url: get_role_url,
headers: {
"Authorization": header_token
},
success: function(data, textStatus, jqXHR) {
var data= JSON.stringify(data);
sap.m.MessageToast.show(data);
},
error: function(jqXHR, textStatus, errorThrown) {
// alert("Error " + csrf);
}
});
},
error: function(jqXHR, textStatus, errorThrown) {
alert("Error in Fetching CSRF");}});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 | |
4 | |
4 | |
4 |