Skip to content
Back

Oauth details are inconsistance

  • 0
  • Web
  • Android
  • Auth
  • Cloud
  • React Native
Axistro
21 Aug, 2025, 06:20

Found some inconsistancy in Oauth (in React Native, dont know if its same case for other sdks )

  1. The getSession does not return ProviderAccessToken or providerAccessTokenExpiry known issue (Stale for a year).
  2. The token has to be fetched from listIdentities .
  3. The providerAccessTokenExpiry gotten from the listIdentities is actually the creation time of the token instead of expiry time. From my research github tokens lasts for 8 hours or Untill user revokes the token. but google says their oauth token lasts for 1 hour so having the creation time instead of expiry time is not good enough.
  4. To create identity

    To create a new identity:

    The user must be logged into their Appwrite account

    Initiate the OAuth2 authentication flow for the desired provider

    The new identity will be automatically created and linked to the current account I am logged in and try to initiate oauth to link i can only go to this point

TypeScript
const result = await WebBrowser.openAuthSessionAsync(`${loginUrl}`, scheme);

i cannot create a session from the result secret and uid as creation of a session is prohibited. so when i just continue instead of creating session the identities are linked but the email is not verified If i would have created/logged in using oauth directly it would have verified my email.

I dont know if any of these are intended , but for more context I created a temporary RN project to check all these I can provide it if you think you need a deeper context.

this is getting more weirder the token was created at "providerAccessTokenExpiry": "2025-08-19T18:15:53.863+00:00", i think its about 9 hours atleast still has not expired I am having trouble when to get a new one or tell user to refresh for new one even the users at github are also confused about what is the actual time limit

TL;DR
Oauth inconsistencies found in React Native SDK: - `getSession` doesn't return `ProviderAccessToken` or `providerAccessTokenExpiry`. - Token needs to be fetched from `listIdentities`. - `providerAccessTokenExpiry` from `listIdentities` shows creation time, not expiry time. - Creating identity requires user to be logged in, initiate OAuth2 flow, but email remains unverified. - Confusion on token expiration time, some say 8 hours, some say 1 hour. - Difficulty in determining when to get a new token or prompt user to refresh. Solution: Contact the developer for more context.
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