
Hey everyone,
I’m running into a weird issue with Appwrite’s Google OAuth provider and would love some insight.
Here’s my setup:
- Stack: React app + Appwrite Cloud (region: FRA)
- SDK init:
const client = new Client()
.setEndpoint('https://fra.cloud.appwrite.io/v1')
.setProject('6567777aa4758208190f');
const account = new Account(client);
Login Flow:
await account.createOAuth2Session(
'google',
'http://localhost:3000/auth/success',
'http://localhost:3000/auth/failure'
);
The Google OAuth popup works, I get redirected back to my success URL, and in the Appwrite dashboard I can see a new active session for my user.
But as soon as I call:
await account.get();
I get this response:
{
"message": "User (role: guests) missing scopes [\"account\"]",
"code": 401,
"type": "general_unauthorized_scope",
"version": "1.8.0"
}
So it looks like the client is still considered a guest even though the session exists.
⸻
What I’ve checked so far: • The project ID and endpoint match between SDK and dashboard. • Google OAuth redirect URI is authorized in Google Cloud and matches Appwrite. • The cookie a_session_6567777aa4758208190f_legacy is present in my browser after login.
Recommended threads
- createPhoneToken not working with expo
` const phoneResponse = await account.createPhoneToken(response.$id, phone);` this gives this error: `OTP error: [AppwriteException: Server Error]` * phone i...
- Google OAuth2 Login Gets Stuck in Redire...
I'm facing an issue with the Google OAuth2 login flow on my Flutter Android app using the Appwrite SDK. After a successful sign-in with Google, the browser ente...
- Cookie expiration date is 6 months inste...
When I login to my app with `createEmailPasswordSession` the cookie has only 6 months of expiration but I have 1 year in Auth settings. I have console-logged th...
