Get Access Token Pkce Flow

Get Access Token Pkce Flow

Use this API instead:

  • /oidc/oauth2/token

This end-point exchanges one of the following grants: authorization_code, refresh_token, client_credentials for an access token.

  1. Include the parameters using application/x-www-form-urlencoded format in the HTTP request body.
  2. Include Basic Base64_Encode(client_id:client_secret) value in the HTTP authorization header. Organization ID parameter notes: when organization id is missing from the request the default organization will be used.
  3. Upon password grant type, user default organization will be set if available.
  4. Upon client_credentials grant type, the organization who own the client will be set if available.

Access Policy

Role Access
Anonymous ✔️
Request
URI
POST
https://vra-interop-222-139.lvn.broadcom.net/csp/gateway/am/api/auth/token
COPY
Header Parameters
string
authorization
Required

Basic auth client credentials [Basic Base64_Encode(client_id:client_secret)].
Example: authorization: Basic Y2xpZW50X2lkOmNsaWVudF9zZWNyZXQ=
Decoding this string will literally return client_id:client_secret.

Note: when using Public OAuth clients, Authorization is required using the format 'Basic Base64_Encode(client_id:)' with empty client_secret.


Request Body

The application/x-www-form-urlencoded form data type.

PkceFlowAuthorizationRequest of mimetype application/x-www-form-urlencoded
Optional
string
grant_type
Required

OAuth grant types for different use cases.

string
code
Optional

Authorization code parameter. Mandatory for grant_type 'authorization_code'.

string
redirect_uri
Optional

Service redirect uri. Mandatory for grant_type 'authorization_code'.

string
refresh_token
Optional

Refresh token parameter. Available for grant_type 'refresh_token'.

string
scope
Optional

Currently not supported. Present for CSP compatibility.

string
org_id
Optional

Unique identifier (GUID) of the organization. Available for grant_type 'client_credentials'.

string
subject_token
Optional

Required if the grant_type is 'client_delegate'. A security token that represents the identity of the party on behalf of whom the request is being made. In client_delegate flow, the token provided MUST BE the access token of the user.

string
subject_token_type
Optional

Required if the grant_type is 'client_delegate'. The identifier for the subject token provided as per RFC 8693 https://tools.ietf.org/html/rfc8693#section-3. In 'client_delegate' flow, this value MUST BE 'urn:ietf:params:oauth:token-type:access_token'.

string
code_verifier
Optional

A high-entropy cryptographic random key using the characters [A-Z] / [a-z] / [0-9] / '-' / '.' / '_' / '~' with a minimum length of 43 characters and a maximum length of 128 characters which was used to generate the 'code_challenge' and obtain the authorization code. Required if PKCE was used in the authorization code grant request. For more information, refer the PKCE RFC at https://tools.ietf.org/html/rfc7636.

string
client_id
Optional

Required if the grant_type is 'authorization_code'.If provided in request body,it must match with the client_id sent in the authorization header.

Authentication
This operation uses the following authentication methods.
Responses
200

OK

Returns AccessToken of type(s) application/json
"AccessToken Object"
string
scope
Optional

Scope

string
access_token
Optional

Access Token

string
refresh_token
Optional

Refresh Token

string
id_token
Optional

ID Token

string
token_type
Optional

Token Type

integer As int64 As int64
expires_in
Optional

Access Token Expiration


400

Invalid request body.

Returns AccessToken of type(s) application/json
"AccessToken Object"
string
scope
Optional

Scope

string
access_token
Optional

Access Token

string
refresh_token
Optional

Refresh Token

string
id_token
Optional

ID Token

string
token_type
Optional

Token Type

integer As int64 As int64
expires_in
Optional

Access Token Expiration


403

Client is forbidden for delegation.

Returns AccessToken of type(s) application/json
"AccessToken Object"
string
scope
Optional

Scope

string
access_token
Optional

Access Token

string
refresh_token
Optional

Refresh Token

string
id_token
Optional

ID Token

string
token_type
Optional

Token Type

integer As int64 As int64
expires_in
Optional

Access Token Expiration


404

Organization with this identifier is not found.

Returns AccessToken of type(s) application/json
"AccessToken Object"
string
scope
Optional

Scope

string
access_token
Optional

Access Token

string
refresh_token
Optional

Refresh Token

string
id_token
Optional

ID Token

string
token_type
Optional

Token Type

integer As int64 As int64
expires_in
Optional

Access Token Expiration


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/x-www-form-urlencoded' -d '{"grant_type:"string"}' https://{api_host}/csp/gateway/am/api/auth/token