Access rights#
Attention
To make requests for viewing, assigning, revoking access rights, the application must receive an access token with the system permission blitz_rights_full_access
.
Tip
To view the access rights of a user where he is a subject, you can also use an access token with the user permission blitz_user_rights
.
The access right is assigned from the access subject to the access object.
users,
applications (prefix
its
).
users,
user groups (prefix
grps
),applications (prefix
its
).
List of user rights#
GET https://login.company.com/blitz/api/v3/rights/of/<sub>
Obtaining access rights by the access subject who is the user.
Examples
GET /blitz/api/v3/rights/of/BIP-1SEQ41A HTTP/1.1
Authorization: Bearer cNwIX…Nz
{
"grps|1147746651733|orgs": {
"ORG_ADMIN": [
"set_from_api",
"another_one_tag"
]
},
"its|test_app2": {
"APP_ADMIN": [
"set_from_api"
]
},
"BIP-3SGR7TA": {
"change_password": [
"parent"
]
}
}
List of application rights#
GET https://login.company.com/blitz/api/v3/rights/of/its/<app_id>
Obtaining access rights by the access subject that is the application.
Examples
GET /blitz/api/v3/rights/of/its/test_app HTTP/1.1
Authorization: Bearer cNwIX…Nz
{
"its|test_app2": {
"SYS_MON": [
"set_from_api"
]
},
"BIP-3SGR7TA": {
"change_password": [
"set_from_api"
]
},
"grps|1147746651733|orgs": {
"ORG_ADMIN": [
"set_from_api"
]
}
}
Rights in relation to the user#
GET https://login.company.com/blitz/api/v3/rights/on/<sub>
Obtaining access rights for an access object that is a user.
Examples
GET /blitz/api/v3/rights/on/BIP-3SGR7TA HTTP/1.1
Authorization: Bearer cNwIX…Nz
{
"BIP 1SEQ41A": [
"change_password"
],
"its|test_app": [
"change_password"
]
}
Rights in relation to a group of users#
GET https://.../blitz/api/v3/rights/on/grps/<grp_id>?objectExt=<profile>
Obtaining access rights for an access object that is a group.
Examples
GET /blitz/api/v3/rights/on/grps/1147746651733?objectExt=orgs HTTP/1.1
Authorization: Bearer cNwIX…Nz
{
"BIP 1SEQ41A": [
"ORG_ADMIN"
],
"its|test_app": [
"ORG_ADMIN"
]
}
Rights in relation to the application#
GET https://login.company.com/blitz/api/v3/rights/on/its/<app_id>
Obtaining access rights for an access object that is an application.
Examples
GET /blitz/api/v3/rights/on/its/test_app2 HTTP/1.1
Authorization: Bearer cNwIX…Nz
{
"BIP 1SEQ41A": [
"APP_ADMIN"
],
"its|test_app": [
"SYS_MON"
]
}
{
"type": "security_error",
"error": "bad_access_token",
"desc": "expired_access_token"
}
Assignment of rights#
PUT https://login.company.com/blitz/api/v3/rights
Assigning access rights.
subject
is the identifier of the subject to whom the right is assigned (user or application identifier);subjectType
is the type of the subject. The parameter is specified only if the right is assigned to the application. In this case, the valueits
is used;object
is the identifier of the object to which the right is assigned (the identifier of a user, user group, or application);objectType
is the type of the object. The parameter is specified only if the right is assigned to a user group (valuegrps
) or to an application (valueits
);rights
is an array with a list of assigned rights to the subject on the object;tags
is an array with a list of tags of assigned rights.
In case of successful assignment of access rights -
HTTP 204 No Content
.If the access token is expired -
HTTP 401 Unauthorized
.If the subject or object does not exist -
HTTP 400 Bad Request
Examples
PUT /blitz/api/v3/rights HTTP/1.1
Authorization: Bearer cNwIXNz
Content-Type: application/json
{
"subject": "BIP-1SEQ41A",
"object": "BIP-3SGR7TA",
"rights": ["change_password"],
"tags": ["set_from_api"]
}
PUT /blitz/api/v3/rights HTTP/1.1
Authorization: Bearer cNwIXNz
Content-Type: application/json
{
"subject": "BIP-1SEQ41A",
"object": "1147746651733",
"objectType": "grps",
"rights": ["ORG_ADMIN"],
"tags": ["set_from_api"]
}
PUT /blitz/api/v3/rights HTTP/1.1
Authorization: Bearer cNwIXNz
Content-Type: application/json
{
"subject": "BIP-1SEQ41A",
"object": "test_app2",
"objectType": "its",
"rights": ["APP_ADMIN"],
"tags": ["set_from_api"]
}
PUT /blitz/api/v3/rights HTTP/1.1
Authorization: Bearer cNwIXNz
Content-Type: application/json
{
"subject": "test_app",
"subjectType": "its",
"object": "BIP-3SGR7TA",
"rights": ["change_password"],
"tags": ["set_from_api"]
}
PUT /blitz/api/v3/rights HTTP/1.1
Authorization: Bearer cNwIXNz
Content-Type: application/json
{
"subject": "test_app",
"subjectType": "its",
"object": "1147746651733",
"objectType": "grps",
"rights": ["ORG_ADMIN"],
"tags": ["set_from_api"]
}
PUT /blitz/api/v3/rights HTTP/1.1
Authorization: Bearer cNwIXNz
Content-Type: application/json
{
"subject": "test_app",
"subjectType": "its",
"object": "test_app2",
"objectType": "its",
"rights": ["SYS_MON"],
"tags": ["set_from_api"]
}
{
"type": "security_error",
"error": "bad_access_token",
"desc": "expired_access_token"
}
{
"type": "process_error",
"error": "unknown_right",
"desc": "The specified right is unknown",
"params": {
"right": "change_password1"
}
}
{
"type": "process_error",
"error": "unknown_user",
"desc": "The specified user is unknown",
"params": {
"userId": "ivanov1"
}
}
{
"type": "process_error",
"error": "unknown_group",
"desc": "The specified group is unknown",
"params": {
"grpId": "1147746651734"
}
}
{
"type": "process_error",
"error": "unknown_rp",
"desc": "The specified relying party is unknown",
"params": {
"rpId": "test_app3"
}
}
Revocation of rights#
DELETE https://login.company.com/blitz/api/v3/rights
Revocation of access rights.
subject
is the identifier of the subject whose right is being revoked (user or application ID);subjectType
is the type of the subject. The parameter is specified only in case of revocation of the application’s rights. In this case, the valueits
is used;object
is the identifier of the object to which the right is being revoked (the identifier of a user, user group, or application);objectType
is the type of the object. The parameter is specified only in case of revocation of the right to a user group (value``grps``) or to an application (valueits
);rights
is an array with a list of revoked rights of the subject to the object;tags
is an array with a list of tags of revoked rights.Warning
If an access right has been assigned to an access subject for an access object with multiple tags, then all tags must also be specified to revoke the access right. If revocation of access rights is not called with full indication of tags, then only the revoked tags will be deleted during revocation, and the access right of the access subject to the access object will remain as long as at least one of the tags remains.
In case of successful revocation of the access right, the service will return
HTTP 204 No Content
.If the access token is expired -
HTTP 401 Unauthorized
.If the revoked right, subject or object does not exist -
HTTP 400 Bad Request
Examples
DELETE /blitz/api/v3/rights HTTP/1.1
Authorization: Bearer cNwIXNz
Content-Type: application/json
{
"subject": "BIP-1SEQ41A",
"object": "BIP-3SGR7TA",
"rights": ["change_password"],
"tags": ["set_from_api"]
}
DELETE /blitz/api/v3/rights HTTP/1.1
Authorization: Bearer cNwIXNz
Content-Type: application/json
{
"subject": "BIP-1SEQ41A",
"object": "1147746651733",
"objectType": "grps",
"rights": ["ORG_ADMIN"],
"tags": ["set_from_api"]
}
DELETE /blitz/api/v3/rights HTTP/1.1
Authorization: Bearer cNwIXNz
Content-Type: application/json
{
"subject": "BIP-1SEQ41A",
"object": "test_app2",
"objectType": "its",
"rights": ["APP_ADMIN"],
"tags": ["set_from_api"]
}
DELETE /blitz/api/v3/rights HTTP/1.1
Authorization: Bearer cNwIXNz
Content-Type: application/json
{
"subject": "test_app",
"subjectType": "its",
"object": "BIP-3SGR7TA",
"rights": ["change_password"],
"tags": ["set_from_api"]
}
DELETE /blitz/api/v3/rights HTTP/1.1
Authorization: Bearer cNwIXNz
Content-Type: application/json
{
"subject": "test_app",
"subjectType": "its",
"object": "1147746651733",
"objectType": "grps",
"rights": ["ORG_ADMIN"],
"tags": ["set_from_api"]
}
DELETE /blitz/api/v3/rights HTTP/1.1
Authorization: Bearer cNwIXNz
Content-Type: application/json
{
"subject": "test_app",
"subjectType": "its",
"object": "test_app2",
"objectType": "its",
"rights": ["SYS_MON"],
"tags": ["set_from_api"]
}
{
"type": "security_error",
"error": "bad_access_token",
"desc": "expired_access_token"
}
{
"type": "process_error",
"error": "unknown_right",
"desc": "The specified right is unknown",
"params": {
"right": "change_password1"
}
}
{
"type": "process_error",
"error": "unknown_user",
"desc": "The specified user is unknown",
"params": {
"userId": "ivanov1"
}
}
{
"type": "process_error",
"error": "unknown_group",
"desc": "The specified group is unknown",
"params": {
"grpId": "1147746651734"
}
}
{
"type": "process_error",
"error": "unknown_rp",
"desc": "The specified relying party is unknown",
"params": {
"rpId": "test_app3"
}
}
The rights of the master user in relation to the slave#
POST https://login.company.com/blitz/api/v3/users/rights/change
Assigning and revoking the rights of the master user in relation to the slave user.
Attention
A revocation request can be executed by an application not only using a user access token obtained for permission named blitz_user_rights
, but also using a system access token obtained for permission named blitz_rm_rights
. In this case, the revocation request may include the``subject`` of any users (to revoke a user’s rights, it will not be necessary for this particular user to log in and receive an access token – the system can revoke the rights of any user).
A header with a permission access token named blitz_user_rights
received by the lead user account should be added to the request.
Assignment of rights
A completed update
block with a list of rights that should be added as a result of the operation.
Each right is described by the parameters:
subject
is the identifier (sub
) of the lead user account;object
is the identifier (sub) of the slave user account;rights
is the list of rights in the array form that the main user account receives in relation to the subordinate user account. For example, to change the account password , specify thechange_password
right, to change attributes, specify thechange_attrs
right, and so on;tags
is a list of tags indicating the reasons for which this user received rights.
Revocation of rights
A completed delete
block with a list of rights that should be revoked as a result of the operation.
Each right is described by the parameters:
subject
is the identifier (sub
) of the lead user account;object
is the identifier (sub) of the slave user account;rights
is a list of rights in the form of an array that are revoked from the master account in relation to the slave account;tags
is a list of tags indicating the reasons for which this user received rights.
If the rights are not assigned or revoked during the execution of the request, then either an empty update
block or an empty delete
block must be present in the request body, respectively. Several assignable/revocable rights can be specified in a single request, but only the user to whom the access token used to call the service was received must be specified as the subject (subject
).
Examples
POST /blitz/api/v3/users/rights/change HTTP/1.1
Authorization: Bearer cNwIXTg
Content-Type: application/json
{
"update":[
{
"subject":"6561d0d9-5583-4bb5-a681-b591358e5fcd",
"object":"5cffd68f-2cb8-4f7a-b0f3-9fa69a1fbbcd",
"rights":[
"change_password"
],
"tags":[
"parent"
]
},
{
"subject":"6561d0d9-5583-4bb5-a681-b591358e5fcd",
"object":"b855957d-bf24-48d4-bb63-cce4f5064590d",
"rights":[
"change_password"
],
"tags":[
"parent"
]
}
],
"delete":[
]
}
POST /blitz/api/v3/users/rights/change HTTP/1.1
Authorization: Bearer cNwIXTg
Content-Type: application/json
{
"update":[
],
"delete":[
{
"subject":"b855957d-bf24-48d4-bb63-cce4f5064590d",
"object":"5cffd68f-2cb8-4f7a-b0f3-9fa69a1fbbcd",
"rights":[
"change_password"
],
"tags":[
"parent"
]
}
]
}
{
"errors" : [
{
"code" : "validation_error",
"params" : {},
"desc" : "(For subject 'dea75b73-a2ba-4b60-a41c-bb640968826b') Incorrect right '' to object '5cffd68f-2cb8-4f7a-b0f3-9fa69a1fbbcd'"
},
{
"params" : {},
"code" : "validation_error",
"desc" : "(For subject 'dea75b73-a2ba-4b60-a41c-bb640968826b') Incorrect tag '' for right 'write' to object '5cffd68f-2cb8-4f7a-b0f3-9fa69a1fbbcd'"
},
{
"desc" : "(For subject 'dea75b73-a2ba-4b60-a41c-bb640968826b') Incorrect object ''",
"code" : "validation_error",
"params" : {}
},
{
"desc" : "Incorrect subject ''",
"code" : "validation_error",
"params" : {}
}
]
}