From Bright Pattern Documentation
Jump to: navigation, search
This page contains changes which are not marked for translation.
• 5.2

Request Access Token

Requests an access token.





Parameter Required? Description Example
grant_type Required The value must be client_credentials "client_credentials"
client_id Required The user's login ID "sheila.thomas"
client_secret Required The user's API secret "qkDwDJlDfig2IpeuUZYKH1Wb8q1V0ju6sILxQQqhJ"
scope Required The tenant or host URL ""


The following HTTP POST requests an access token for the web service. The client_id identifies the user on behalf of the application using the access token.

POST /configapi/v2/oauth/token HTTP/1.1


Content-Type: application/x-www-form-urlencoded


Access Token Response

A successful response contains a JSON OAuth 2.0 response with the following parameters.


Parameter Description
access_token The requested access token. The calling application can use this token to authenticate to the receiving service.
token_type Indicates the token type value. The only supported type is Bearer.

For more information about bearer tokens, see The OAuth 2.0 Authorization Framework: Bearer Token Usage (RFC 6750).

expires_in How long the access token is valid (in seconds)

Example Response

The following example shows a response to a successful request for an access token to a web service.


Use the Access Token to Access the Resource

Now when an access_token is successfully acquired, it is possible to use the token in requests to Web APIs by including it in the Authorization header. RFC 6750 explains how to use bearer tokens in HTTP requests to access protected resources.

Authenticated API Request Example

GET /data HTTP/1.1


Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbW4t

< Previous | Next >