# Revoking an outh2 token

**URL:** <https://devforum.okta.com/t/revoking-an-outh2-token/21666>\
**Category:** OAuth/OIDC\
**Created:** [August 23, 2022, 5:28pm UTC](https://devforum.okta.com/t/revoking-an-outh2-token/21666 "2022-08-23T17:28:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bkief](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@Bkief](https://devforum.okta.com/u/Bkief)\
**Post date:** [August 23, 2022, 5:28pm UTC](https://devforum.okta.com/t/revoking-an-outh2-token/21666/1 "2022-08-23T17:28:52Z")

</div>

I am using the /authorize /token endpoints from a browser app to login using oauth2 but I am unable to log the user out using /revoke. The previous two endpoint support cors but the /revoke endpoint doesn’t. I tried adding my origin to The trusted Origins but that didn’t work. When reading through the cors docs it mentions that Cors enabled apis and endpoints should be marked with a Cors logo I haven’t seen this logo used in any of the documentation outside of the cors. The logout token is for id token which is not for the authorization flow. I seem unable to log the user out of the default authorization server. I can’t clear the information in my app but okta is caching the sign in information. The only way to remove the session is to complete close the browser. This seems like a security flaw. Am I missing something how to I revoke the token?

---

<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 23, 2022, 8:21pm UTC](https://devforum.okta.com/t/revoking-an-outh2-token/21666/2 "2022-08-23T20:21:48Z")

</div>

Are you getting a CORS error for the /revoke endpoint, or are you getting a different kind of error?

Are you making the /revoke request to the same issuer as in your authorize request, e.g if you make a request to [https://org.okta.com/oauth2/v1/authorize](https://org.okta.com/oauth2/v1/authorize), are you then trying to make a request to [https://org.okta.com/oauth2/v1/revoke](https://org.okta.com/oauth2/v1/revoke)?

---

<div class="post-metadata">

**Author:** ![Bkief](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@Bkief](https://devforum.okta.com/u/Bkief)\
**Post date:** [August 23, 2022, 8:52pm UTC](https://devforum.okta.com/t/revoking-an-outh2-token/21666/3 "2022-08-23T20:52:23Z")

</div>

I was getting confused by

`Has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.`

from the browser. I removed the bearer token from the request and i can make a /revoke call but this doesn’t stop okta from auto logging in the user after it was revoked. How do I clear the saved session information that okta uses to login the user?

---

<div class="post-metadata">

**Author:** ![Bkief](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@Bkief](https://devforum.okta.com/u/Bkief)\
**Post date:** [August 23, 2022, 10:16pm UTC](https://devforum.okta.com/t/revoking-an-outh2-token/21666/4 "2022-08-23T22:16:40Z")

</div>

I figure out how to call /logout by rereading the docs and requesting the openid for the scope in the /token. Can successfully call /logout which logs me out.

---

<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 24, 2022, 10:16pm UTC](https://devforum.okta.com/t/revoking-an-outh2-token/21666/5 "2022-08-24T22:16:51Z")

</div>

Closed on August 24, 2022, 10:16pm UTC

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