Skip to main content

Main endpoint to obtain OAuth2 tokens.

POST 

/oauth2/token

The OAuth2 token endpoint supports the following grant types:

  • client_credentials: this issues a client access_token which can be used by any Teneo component without the specification of any user.

    E.g. grant_type=client_credentials&client_id=123e4567-e89b-12d3-a456-426614174000&client_secret=123e4567-e89b-12d3-a456-426614174000

  • password: this issues a user access_token; the issued token has the user and the client as its context. This is commonly used by the Teneo components when a user logs in.

    E.g. grant_type=password&client_id=123e4567-e89b-12d3-a456-426614174000&client_secret=123e4567-e89b-12d3-a456-426614174000&username=user1&password=pass1

  • refresh_token: this issues a new access_token using a refresh_token. Access tokens expire at a certain point, so Teneo components use this type to obtain a new access_token without the need to ask for the user credentials again.

    E.g. grant_type=refresh_token&client_id=123e4567-e89b-12d3-a456-426614174000&client_secret=123e4567-e89b-12d3-a456-426614174000&refresh_token=123e4567-e89b-42d3-a456-556642440000

Note: in order to issue an admin token use the client_credentials gran type; apply the admin user as client_id and the password as client_secret. Both a user assigned the administrator role and the built-in admin user can be used for this purpose.

E.g. grant_type=client_credentials&client_id=admin&client_secret=admin_pass

Request

Responses

Generates a valid oauth2 token and returns it in the response.