Create Auth Token

POST

Creates a JWT corresponding to the requested token type for the authenticated user.

Request

This endpoint expects an object.
grant_typeenumRequired
Allowed values: urn:devrev:params:oauth:grant-type:token-issueurn:ietf:params:oauth:grant-type:token-exchange

Specifies the process of obtaining a token.

requested_token_typeenumRequired

The type of the requested token.

rev_infoobjectRequired

Carries info corresponding to the Rev user to be provisioned and/or issue a Rev session token.

subject_token_typeenumRequired

The type of the subject token.

act_asstringOptional

The unique ID of the Dev user or the service account to impersonate.

audlist of stringsOptional

The expected audience values with respect to the token.

client_idstringOptional

An identifier that represents the application which is requesting the token. If no client_id is present in the request to generate an application access token (AAT), DevRev will generate a client_id. This client_id is only associated with an AAT.

expires_indoubleOptional>=0<=4294967295

The expected validity lifetime of the token in number of days. In practice, the value should be based on the usage of the token.

scopestringOptional

The requested set of scopes associated with the issued token. A space-delimited list of values in which the order of values does not matter.

subject_tokenstringOptional

Represents the entity that requests the token. Not required when requesting an application access token (AAT).

token_hintstringOptional

A hint that identifies the token.

Response

Response for the request to create a new token corresponding to the requested token type.

access_tokenstring

The issued JSON Web Token (JWT) corresponding to the requested token type.

expires_inlong

The validity lifetime of the token specified in seconds since Unix epoch.

token_typeenum
Allowed values: bearer

The type of the issued token. Bearer is the only supported token type.

client_idstringOptional

An identifier that represents the application which is requesting the token. Only present in a response corresponding to an application access token (AAT).

refresh_tokenstringOptional

A token to refresh the issued token.

scopestringOptional

The scopes associated with the issued token. A space-delimited list of values in which the order of values does not matter.

Built with