Create Access Token Flow

post

/oauth2/rest/token

Request

Supported Media Types
Header Parameters
  • Base64 encoded header of clientID:secret. This is an authentication mechanism for the Confidential Clients. Client Authentication can be specified through this header or ClientAssertionTokens. Either one of these mechanisms should be used.
  • Identity Domain under which the token is being requested.
Form Parameters
  • User Assertion token.Mandatory parameter in case GrantType is JWT_BEARER.
  • Client Assertion token. This is mandatory if the Client Authentication mechanism is via the ClientAssertionToken. If this is passed, then the authorization header is not required.
  • Type of client assertion. This is mandatory if the Client Authentication mechanism is via the ClientAssertionToken. If this is passed, then the authorization header is not required.
    Allowed Values: [ "JWT_BEARER", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" ]
  • Authorization Code obtained.Mandatory parameter in case GrantType is AUTHORIZATION_CODE.
  • Grant Type for the Access Token Request
    Allowed Values: [ "CLIENT_CREDENTIALS", "AUTHORIZATION_CODE", "PASSWORD", "JWT_BEARER", "REFRESH_TOKEN" ]
  • Password of resource owner.Mandatory parameter in case GrantType is PASSWORD.
  • Redirect URI.Mandatory parameter in case GrantType is AUTHORIZATION_CODE.
  • Refresh Token played to generate the new Access Token.Mandatory parameter in case GrantType is REFRESH_TOKEN.
  • Scope requested in the Access Token. In case of REFRESH_TOKEN flows, defaulted to the values in the RefreshToken if not specified.
    Default Value: DefaultScope defined for Client
  • Username of resource owner. Mandatory parameter in case GrantType is PASSWORD.

Response

Supported Media Types

200 Response

Access Token was generated successfully
Body ()
Root Schema : AccessToken
Type: object
Show Source

400 Response

Bad Request
Body ()
Root Schema : ErrorCode
Type: object
Show Source

Examples

The following cURL command shows a sample request against the server for creating access tokens using Resource Owner Credentials in 2 - Legged Flows.

Note:

Headers of interest in requests

  • Authorization : Base64 Url encoded ClientID:secret combination. 

  • X-OAUTH-IDENTITY-DOMAIN-NAME: Identity Domain that the client belongs to.

cURL Example

curl -i -H 'Authorization: Basic U1NPTGlua0NsaWVudDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" -H "X-OAUTH-IDENTITY-DOMAIN-NAME: SSOLink" --request POST http://<ManagedServerHost>:<ManagedServerPort>/oauth2/rest/token -d 'grant_type=PASSWORD&username=weblogic&password=welcome1&scope=SSOLink.link1'