Accelerate the Value of Data

Assign Role-based Tenants to a User

Assign Role-based Tenants to a User

Request

PUT {oauth_uri}/users/{userName}/tenantRoles

This API assigns role-based tenants to the user. Using this API, the tenants can be mapped to roles, and, when you assign those roles to the user: the user gets role-based access to individual tenants.

Table 1. Parameters
Parameter Name Required Details
Headers Authorization Yes Information about authentication access token in format Bearer <accessToken> (see details in Authentication API).
Content-Type Yes Should be Content-Type: application/json.
Body Yes JSON Array with all the roles and tenants of that role applicable for the user.

Response

The response contains a JSON object of successfully updated role-based tenants.

Assigning Role-based Tenants to a User

Request

PUT {oauth_uri}/users/testadminuser/tenantRoles
Headers: Authorization: Bearer <Access-Token>
 
Request Body:
    {  
        "roles": {
                "ROLE_API":["t1", "t2"],
                "ROLE_ADMIN_TENANT":["t1"],
                "ROLE_TEST": ["t3"]
            }
    }           

Response

{  
    "roles": {
            "ROLE_API":["t1", "t2"],
            "ROLE_ADMIN_TENANT":["t1"],
            "ROLE_TEST": ["t3"]
        }
}