Skip to main content

oauth2

📄️ /oauth2/token

The OAuth2 token endpoint supports the following grant types:<ul> <li> <b>client_credentials:</b> this issues a client access_token which can be used by any Teneo component without the specification of any user. <p> E.g. <code>grant_type=client_credentials&amp;client_id=123e4567-e89b-12d3-a456-426614174000&amp;client_secret=123e4567-e89b-12d3-a456-426614174000</code> </p> </li> <li> <b>password:</b> 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. <p> E.g. <code>grant_type=password&amp;client_id=123e4567-e89b-12d3-a456-426614174000&amp;client_secret=123e4567-e89b-12d3-a456-426614174000&amp;username=user1&amp;password=pass1</code> </p> </li> <li> <b>refresh_token:</b> 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. <p> E.g. <code>grant_type=refresh_token&amp;client_id=123e4567-e89b-12d3-a456-426614174000&amp;client_secret=123e4567-e89b-12d3-a456-426614174000&amp;refresh_token=123e4567-e89b-42d3-a456-556642440000</code> </p> </li></ul>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.<p>E.g. <code>grant_type=client_credentials&amp;client_id=admin&amp;client_secret=admin_pass</code> </p>