POST OAuth/EnumerateGrants
Enumerates all grants for an application, user, or combination of both.
Requirements
- Roles: Admin, Grant Admin, Auditor, or Application Owner. See OAuth roles for more information.
- Token scope: Admin
Headers
-
Content type: Content-Type:application/json.
- Token: The bearer access token that you received. For example, Authorization:Bearer 4MyGeneratedBearerTknz==. For more information, see Passing a bearer token in your API calls.
Parameters
At least one of the following parameters is required.
Name |
Description |
---|---|
GranteePrefixedUniversal string |
The prefixed universal for the identity whose grants will be enumerated. |
ApplicationID |
The ID of the application. |
Returns
Name |
Description |
---|---|
HTTP 200 |
See OAuth result codes. A Grants object is returned with the following values:
|
HTTP 400 |
For invalid requests, this call returns HTTP 400 Bad Request and the following data in the message body:
|
HTTP 401 |
For authentication errors, this call returns HTTP 401 Unauthorized and the following data in the message body:
|
HTTP 403 |
If the response is HTTP 403 Forbidden, the requester's token does not include the admin scope. Call POST Authorize/Oauth with the correct scope and restriction. Update the header with the new token and retry.
|
Example
Request
POST /vedsdk/oauth/EnumerateGrants HTTP/1.1 Host: tpp-server-url Content-Type: application/json Accept: application/json Authorization: Bearer 4MyGeneratedBearerTknz== { "GranteePrefixedUniversal": "local:{5be5a591-c842-4520-9142-b455f4ad2286}", "ApplicationId": "CodeSigningAuditor" }
Response
{ "Grants": [ { "AccessIssuedOn": "/Date(1669921819303)/", "AccessIssuedOnISO8601": "2022-12-01T19:10:19Z", "AccessIssuedOnUnixTime": 1669921819, "Application": "CodeSigningAuditor", "Expires": "/Date(1677697819303)/", "ExpiresISO8601": "2023-03-01T19:10:19Z", "ExpiresUnixTime": 1677697819, "GrantIssuedOn": "/Date(1669921819303)/", "GrantIssuedOnISO8601": "2022-12-01T19:10:19Z", "GrantIssuedOnUnixTime": 1669921819, "GranteePrefixedUniversal": "local:{5be5a591-c842-4520-9142-b455f4ad2286}", "Scope": "codesign:manage", "ValidFor": 7776000 } ], "Result": 0, "Success": true }