Skip to content
Back

general_unauthorized_scope

  • 0
  • 4
  • Web
shazzsamed
17 Jan, 2026, 16:59

localhost oauth not working. general_unauthorized_scope error showing.

{ "message": "User (role: guests) missing scopes ([account])", "code": 401, "type": "general_unauthorized_scope", "version": "1.8.1" } followed th eoauth flow exatcly. Why this error. Documentation for stuff like these are very bad

TL;DR
If using custom domains, it's okay to use the createOAuth2Session method. Otherwise, sessions created by this method may be deleted for third-party cookies. It is recommended to follow the methods outlined in the provided blog post for OAuth2 in Appwrite Cloud. The createOauth2Token method is suggested over the createOAuth2Session method, especially for React Native. The latter may not work on RN, so the former is the only available method for OAuth in RN.
17 Jan, 2026, 17:05

You might be using the createOauthSession method?

17 Jan, 2026, 17:05

As in this?

TypeScript
account.createOAuth2Session({
    provider: OAuthProvider.Github,
    success: 'https://example.com/success', // redirect here on success
    failure: 'https://example.com/failed', // redirect here on failure
    scopes: ['repo', 'user'] // scopes (optional)
});
18 Jan, 2026, 04:26

Yes Shoudl i not use that ?

18 Jan, 2026, 04:32

If you use custom domains this is ok. Else the session created by this method will be deleted for third party cookies. In the oauth docs select the react native one. That shows how to use createOauth2Token

This method is somewhat better than the session method. And dont worry, same method works for web as I use it.

18 Jan, 2026, 04:34

cc: <@257295349314486273> it will be better to update the docs to follow the methods told in the blog https://appwrite.io/blog/post/fixing-oauth2-issues-in-appwrite-cloud

1
19 Jan, 2026, 15:57

<@822500146658017292> can you create a task for our team to look into updating this later?

1
22 Jan, 2026, 15:44

qq on this. Is the recommendation to use Oauth2 tokens in a react native app? so we should be using the instructions outlined in the doc above? rather than createOAuth2Session

22 Jan, 2026, 15:52

Yes

22 Jan, 2026, 15:59

thanks. Even for apple authentication?

22 Jan, 2026, 16:00

Its recommended in docs for react native. And I think the createOAuth2Session method does not work on RN. So this is the only method available for oauth's in RN.

1
22 Jan, 2026, 19:12

I can't seem to get the createOauth2Token method to work on React Native on an ios simulator. I used the exact code in the link above. anyone else got it working?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more