Token

To obtain an Access Token, an ID Token, and optionally a Refresh Token, the RP (Client).

Changed on

To obtain an Access Token, an ID Token, and optionally a Refresh Token, the RP (Client).

post/restv1/token

Request

  • Base URL
    https://jans.local.io/jans-auth
  • Auth
    none declared

Request body application/x-www-form-urlencoded

grant_typestring[] required

Provide a list of the OAuth 2.0 grant types that the Client is declaring that it will restrict itself to using.

codestring

Code which is returned by authorization endpoint. (For grant_type=authorization_code)

redirect_uristring

Redirection URI to which the response will be sent. This URI MUST exactly match one of the Redirection URI values for the Client pre-registered at the OpenID Provider.

usernamestring

End-User username.

passwordstring

End-User password.

scopestring[]

OpenID Connect requests MUST contain the openid scope value. If the openid scope value is not present, the behavior is entirely unspecified. Other scope values MAY be present. Scope values used that are not understood by an implementation SHOULD be ignored.

assertionstring

Assertion JWT. Used with grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer (e.g. ID-JAG bearer grant).

refresh_tokenstring

Refresh token.

client_idstring

OAuth 2.0 Client Identifier valid at the Authorization Server.

client_secretstring

The client secret. The client MAY omit the parameter if the client secret is an empty string.

code_verifierstring

The client's PKCE code verifier.

ticketstring
claim_tokenstring
claim_token_formatstring
pctstring
rptstring
subject_tokenstring

Security token representing the identity of the party on behalf of whom the request is being made. Used with grant_type=urn:ietf:params:oauth:grant-type:token-exchange.

subject_token_typestring

Identifier for the type of subject_token. For example urn:ietf:params:oauth:token-type:id_token, urn:ietf:params:oauth:token-type:saml2, or urn:ietf:params:oauth:token-type:refresh_token.

requested_token_typestring

Identifier for the type of the requested security token. For example urn:ietf:params:oauth:token-type:id-jag or urn:ietf:params:oauth:token-type:txn-token.

audiencestring

The logical name of the target service or resource where the client intends to use the requested security token. Used with grant_type=urn:ietf:params:oauth:grant-type:token-exchange.

actor_tokenstring

Security token representing the actor. Used in delegation scenarios with grant_type=urn:ietf:params:oauth:grant-type:token-exchange.

actor_token_typestring

Identifier for the type of actor_token.

Example request

{
  "grant_type": [
    "authorization_code",
    "client_credentials"
  ],
  "subject_token_type": "urn:ietf:params:oauth:token-type:id_token",
  "requested_token_type": "urn:ietf:params:oauth:token-type:id-jag",
  "actor_token_type": "urn:x-oath:params:oauth:token-type:device-secret"
}

Response

OK

access_tokenstring required

The access token issued by the authorization server.

token_typestring required

The access token type provides the client with the information required to successfully utilize the access token to make a protected resource request (along with type-specific attributes).

expires_ininteger

The lifetime in seconds of the access token. For example, the value "3600" denotes that the access token will expire in one hour from the time the response was generated.

refresh_tokenstring

The refresh token, which can be used to obtain new access tokens using the same authorization grant

scopestring[]
id_tokenstring
issued_token_typestring

Identifier for the type of the issued token. Present in token exchange responses. For example urn:ietf:params:oauth:token-type:id-jag or urn:ietf:params:oauth:token-type:txn-token.

Example response

{
  "scope": [
    "openid",
    "oxd"
  ],
  "issued_token_type": "urn:ietf:params:oauth:token-type:id-jag"
}

Changes

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status

    • info

      endpoint added