Skip to content
Back

OAUTH Error 400

  • 1
  • Android
  • React Native
  • Apple
ABNS
8 Jul, 2025, 14:09

I’m encountering an issue with authentication with google or apple in my Expo React Native app. It was working previously, but it has recently stopped keeping, and I’m now receiving the following error:

Error 400 Invalid success param: Invalid URI. Register your new client (localhost) as a new platform on your project console dashboard general_argument_invalid

Has there been a recent update or change that could be causing this? Any guidance on resolving this would be appreciated.

TL;DR
Developers facing OAUTH Error 400 after a previous successful login in React Native Expo app. Error mentions 'localhost' needing to be added as a new platform in the project console dashboard. Solution involves adjusting the code for 'loginWithOAuth' by updating the redirectScheme to include 'localhost' and ensuring proper redirection is possible for authentication.
Axistro
8 Jul, 2025, 14:39

Can you provide the function code?

ABNS
8 Jul, 2025, 14:41
ABNS
8 Jul, 2025, 14:41

thats the function

ABNS
8 Jul, 2025, 14:44

`export const loginWithOAuth = async (provider: OAuthProvider) => {

let redirectScheme = makeRedirectUri({ preferLocalhost: true });

//HACK: localhost is a hack to get the redirection possible if (!redirectScheme.includes('localhost')) { redirectScheme = ${redirectScheme}localhost; }

const url = account.createOAuth2Token(provider, redirectScheme); if (!url) return;

const result = await openAuthSessionAsync(url.href, redirectScheme); if ('url' in result) { const resultUrl = new URL(result.url); const secret = resultUrl.searchParams.get('secret'); const userId = resultUrl.searchParams.get('userId'); if (!secret || !userId) return; await account.createSession(userId, secret); } return true; };`

ABNS
8 Jul, 2025, 14:44

and thats the loginWithOAuth

Axistro
8 Jul, 2025, 14:47

Just try adding localhost as a platform as the error says in the console

ABNS
8 Jul, 2025, 14:48

i have it already

ABNS
8 Jul, 2025, 14:48

the login was working fine previously like i said

Axistro
8 Jul, 2025, 14:51

The team was working on support for expo go. Maybe something changed in the code for this.

Axistro
8 Jul, 2025, 14:52

@Steven sorry for the ping. Can you help here? This a new kind of error.

ABNS
8 Jul, 2025, 14:52

Yeah that's what i want to confirm

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