steep-summer-29793
03/21/2024, 5:36 AMcurl --location --request POST '<https://some_domain/oauth2/introspect?scope=revoke_token&token=5cjE7x53qToc-FnfCsg1KD1RIWDg4-cP3GgCipRt0peE.SGUie_jGhgnlpunErjg4kcfbSabHjhDwIhzMwH4dO_I>'
magnificent-energy-493
/oauth2/revoke
endpoint, not the /oauth2/introspect
endpoint. The introspect endpoint is used to get details about a token, not to revoke it.
Here is an example of how to revoke a token using the Ory CLI:
ory revoke token --client-id your-client-id --client-secret your-client-secret your-token
Replace your-client-id
, your-client-secret
, and your-token
with your actual client ID, client secret, and the token you want to revoke.
You can also use the Ory Hydra CLI:
hydra revoke token --client-id your-client-id --client-secret your-client-secret your-token
Again, replace your-client-id
, your-client-secret
, and your-token
with your actual values.
If you want to use a HTTP request, you can use the POST /oauth2/revoke
endpoint. Here is an example:
curl --location --request POST '<https://your-domain/oauth2/revoke>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=your-client-id' \
--data-urlencode 'client_secret=your-client-secret' \
--data-urlencode 'token=your-token'
Replace your-domain
, your-client-id
, your-client-secret
, and your-token
with your actual values.
Please note that you need to be authenticated to perform this operation. The authentication methods supported are basic and oauth2.
For more details, please refer to the Ory API Reference and the Hydra API Reference.