# Identity provider - handling user revokes app access (github/bitbucket)

**URL:** <https://community.auth0.com/t/identity-provider-handling-user-revokes-app-access-github-bitbucket/55815>\
**Category:** Get Help\
**Tags:** github, bitbucket-extension, identity, nextjs\
**Created:** [January 7, 2021, 2:03pm UTC](https://community.auth0.com/t/identity-provider-handling-user-revokes-app-access-github-bitbucket/55815 "2021-01-07T14:03:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![talkl120](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/talkl120/32/26234_2.png) [@talkl120](https://community.auth0.com/u/talkl120)\
**Post date:** [January 7, 2021, 2:03pm UTC](https://community.auth0.com/t/identity-provider-handling-user-revokes-app-access-github-bitbucket/55815/1 "2021-01-07T14:03:42Z")

</div>

Hello,

I’m building a next js web app that has github and bitbucket as identity providers and cache their access token in order to access their rest api.  
I’m wondering how should I handle revoked app access manually by the user?

by that I mean that if a user entered their Github/Bitbucket account and revoked my app from accessing their account, how should I know about it in my app, and how I should handle it with auth0 such that the user will be prompted to authorise again my app?

Thank you,  
Tal

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [January 7, 2021, 7:19pm UTC](https://community.auth0.com/t/identity-provider-handling-user-revokes-app-access-github-bitbucket/55815/3 "2021-01-07T19:19:10Z")

</div>

Hi @talkl120,

Which Auth0 SDK are you using in your application?

I’m doing some research on this and will let you know what I find!

Thanks,

Stephanie

---

<div class="post-metadata">

**Author:** ![talkl120](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/talkl120/32/26234_2.png) [@talkl120](https://community.auth0.com/u/talkl120)\
**Post date:** [January 7, 2021, 7:53pm UTC](https://community.auth0.com/t/identity-provider-handling-user-revokes-app-access-github-bitbucket/55815/4 "2021-01-07T19:53:06Z")

</div>

Auth0/nextjs-auth0

Thnx

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [January 8, 2021, 1:00pm UTC](https://community.auth0.com/t/identity-provider-handling-user-revokes-app-access-github-bitbucket/55815/5 "2021-01-08T13:00:26Z")

</div>

Here is one solution that comes to mind–When the request to the GitHub/BitBucket API is called with a revoked token, the response should be a 403. Your app could handle this error by logging the user out of the application ([docs](https://github.com/auth0/nextjs-auth0#logout)). Have you tried out this approach?

---

<div class="post-metadata">

**Author:** ![talkl120](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/talkl120/32/26234_2.png) [@talkl120](https://community.auth0.com/u/talkl120)\
**Post date:** [January 9, 2021, 10:10am UTC](https://community.auth0.com/t/identity-provider-handling-user-revokes-app-access-github-bitbucket/55815/6 "2021-01-09T10:10:22Z")

</div>

yeah i’ll guess i’ll have to test what happens when i revoke the app and implement some kind of an interceptor with axios. will update

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 24, 2021, 10:10am UTC](https://community.auth0.com/t/identity-provider-handling-user-revokes-app-access-github-bitbucket/55815/7 "2021-01-24T10:10:29Z")

</div>

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