# Revoke API not working

**URL:** <https://devforum.okta.com/t/revoke-api-not-working/21435>\
**Category:** OAuth/OIDC\
**Created:** [August 1, 2022, 5:32am UTC](https://devforum.okta.com/t/revoke-api-not-working/21435 "2022-08-01T05:32:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![manoj-matellio](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@manoj-matellio](https://devforum.okta.com/u/manoj-matellio)\
**Post date:** [August 1, 2022, 5:32am UTC](https://devforum.okta.com/t/revoke-api-not-working/21435/1 "2022-08-01T05:32:35Z")

</div>

We are using revoke api as we want to invalidate access token, on revoke api call, we are getting status code with 200 status, but still that token on verify, shows its valid.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [August 1, 2022, 8:44pm UTC](https://devforum.okta.com/t/revoke-api-not-working/21435/2 "2022-08-01T20:44:00Z")

</div>

Are you using the /introspect endpoint to validate the token, or are you locally validating it? Local token validation will never take into consideration the state of the token on the server itself. You can only check if a token has been revoked (using the revocation endpoint) by sending it back to the introspection endpoint.

This is also mentioned in our guide about how to [Validate Access Tokens](https://developer.okta.com/docs/guides/validate-access-tokens/dotnet/main/#validating-a-token-remotely-with-okta).

---

<div class="post-metadata">

**Author:** ![manoj-matellio](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@manoj-matellio](https://devforum.okta.com/u/manoj-matellio)\
**Post date:** [August 2, 2022, 9:22am UTC](https://devforum.okta.com/t/revoke-api-not-working/21435/3 "2022-08-02T09:22:07Z")

</div>

I have tried using introspect endpoint. but its always giving status code 200 with active state false

…com/oauth2/v1/introspect

![image](https://global.discourse-cdn.com/oktadev/original/2X/e/ead953f6f318e0d42ba941b1fd9ba2dd7e2fa334.png)  
 ![image](https://global.discourse-cdn.com/oktadev/original/2X/b/ba9d547a2c75372d28ae334fe24539e69744e905.png)

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [August 2, 2022, 3:29pm UTC](https://devforum.okta.com/t/revoke-api-not-working/21435/4 "2022-08-02T15:29:08Z")

</div>

So after revoking, the introspect endpoint reports that the token is `"active": false`? This is expected/the desired behavior. The introspect endpoint will reflect the status of the token on the authorization server side, so when you make your `/v1/revoke` request, you toggled the status of the token from `"active":true` to `"active":false`

---

<div class="post-metadata">

**Author:** ![manoj-matellio](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@manoj-matellio](https://devforum.okta.com/u/manoj-matellio)\
**Post date:** [August 3, 2022, 4:46am UTC](https://devforum.okta.com/t/revoke-api-not-working/21435/5 "2022-08-03T04:46:11Z")

</div>

No, Even before i make call to revoke API, its giving status “active”:false

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [August 3, 2022, 4:11pm UTC](https://devforum.okta.com/t/revoke-api-not-working/21435/6 "2022-08-03T16:11:11Z")

</div>

What’s the value of the `iss` claim in your token and does it match the /revoke URL you are using? You want to make sure you make the revocation call to the same authorization server, aka `iss`/v1/revoke

---

<div class="post-metadata">

**Author:** ![manoj-matellio](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@manoj-matellio](https://devforum.okta.com/u/manoj-matellio)\
**Post date:** [August 4, 2022, 6:33am UTC](https://devforum.okta.com/t/revoke-api-not-working/21435/7 "2022-08-04T06:33:58Z")

</div>

[https://dev-45144393.okta.com/oauth2/v1/introspect](https://dev-45144393.okta.com/oauth2/v1/introspect)  
[https://dev-45144393.okta.com/oauth2/v1/revoke](https://dev-45144393.okta.com/oauth2/v1/revoke)

{  
ver: 1,  
jti: ‘AT.SF4NwZkvomCNB4oy0Dl3ZzijXy0gfHvs\_ZbcZONY-OM’,  
iss: ‘[https://dev-45144393.okta.com/oauth2/default](https://dev-45144393.okta.com/oauth2/default)’,  
aud: ‘api://default’,  
iat: 1659593366,  
exp: 1659596966,  
cid: ‘0oahclrvabTRx8ohK6r3’,  
uid: ‘00ufzb7ilbgqDmEKk2p7’,  
scp: [‘openid’, ‘profile’, ‘email’],  
auth\_time: 1659589604,  
sub: ‘manoj@yopmail.com’  
}

This is claim, and url above, which i am using, and really i am getting false status for active token, before and after revoke

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [August 4, 2022, 9:21pm UTC](https://devforum.okta.com/t/revoke-api-not-working/21435/8 "2022-08-04T21:21:43Z")

</div>

Based on the `iss` in the token payload you’ve shared, you should be using the following endpoints instead:  
[https://dev-45144393.okta.com/oauth2/default/v1/introspect](https://dev-45144393.okta.com/oauth2/default/v1/introspect)  
[https://dev-45144393.okta.com/oauth2/default/v1/revoke](https://dev-45144393.okta.com/oauth2/default/v1/revoke)

---

<div class="post-metadata">

**Author:** ![manoj-matellio](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@manoj-matellio](https://devforum.okta.com/u/manoj-matellio)\
**Post date:** [August 5, 2022, 2:45pm UTC](https://devforum.okta.com/t/revoke-api-not-working/21435/9 "2022-08-05T14:45:29Z")

</div>

Thank you so much @andrea , Its working as expected. Great thanks

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [August 6, 2022, 2:46pm UTC](https://devforum.okta.com/t/revoke-api-not-working/21435/10 "2022-08-06T14:46:08Z")

</div>

Closed on August 6, 2022, 2:46pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
