Revoking a token
How to revoke any kind of access or refresh token
Last updated
How to revoke any kind of access or refresh token
Last updated
Any previously generated access tokens ( included) can be revoked before their natural .
To revoke a token, send a POST
request to the /oauth/revoke
endpoint, passing the required parameters in the request body. In addition to the token you need to revoke:
non-confidential (public) API credentials that have a customer or a user in the JWT — e.g. sales channel using the or flow — require .
confidential (private) API credentials — e.g. integration, webapps — and non-confidential (public) API credentials that don't have a customer or a user in the JWT — e.g. guest sales channels using the flow — require .
POST https://auth.commercelayer.io/oauth/revoke
client_id
String
Required
Your client ID (from your API credentials).
client_secret
String
Optional
Your client secret (required for confidential API credentials and non-confidential API credetials without a customer or a user in the JWT only).
token
String
Required
A valid access or refresh token.
The following request revokes an access token generated for a sales channel public API credential using the password
grant type, before its natural expiration date:
The following request revokes an access token generated for a private API credential (e.g. integration, webapp, etc.), before its natural expiration date:
The following request revokes a refresh token used to refresh a customer's access token with a "remember me" option (sales channel), before its natural expiration date:
To revoke a refresh token used to skip the (webapp), remember to add the webapp client secret to the payload.