Skip to content
Back

Google Authentication problem with no error code

  • 0
  • Android
  • React Native
  • Auth
iftikhar
21 Aug, 2025, 14:31

Hello everyone, I’m encountering an issue with authentication with google in my Expo React Native app. It was working fine two weeks back, but it has recently stopped working.

When it stopped working I was 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

To resolve this issue, I followed the steps as described in this thread https://discord.com/channels/564160730845151244/1392145684920008864

However after making the changes my android emulator will not pop up the google auth window nor give me any error the screen will be white for ever.

Please note the app is based on React Native + Expo. If I open the app in web it works fine and will let me sign in and out via OAUTH, on the web it always work.

TL;DR
Developer is facing authentication issues with Google in their Expo React Native app. The error code "Invalid success param: Invalid URI. Register your new client (localhost) as a new platform on your project console dashboard" was showing up. The solution involves updating the linking URL to appwrite-callback-projectid as per the documentation provided. The developer shared their code snippet and mentioned successful operation on the web but facing issues in the Android emulator.
iftikhar
21 Aug, 2025, 14:32

here is the code snippet which works fine on web. Here is my code snippet.

TypeScript
   setLoadingGoogle(true);
   setError(null);
   try {
     const redirectUrl = Linking.createURL("auth-callback");

     // Appwrite handles OAuth2 URL generation
     const loginUrl = account.createOAuth2Token(
       OAuthProvider.Google,
       redirectUrl,
       redirectUrl
     );

     if (Platform.OS === "web") {
       // On web → full redirect
       window.location.href = loginUrl;
       return;
     } else {
       // On native → open in modal
       const result = await WebBrowser.openAuthSessionAsync(
         loginUrl,
         redirectUrl
       );

       if (result.type === "success" && result.url) {
         const userInfo = await account.get();
         console.log("Google OAuth user:", userInfo);
       } else if (result.type === "cancel") {
         setError("Google login cancelled.");
       } else {
         setError("Google login failed. Please try again.");
       }
     }
   } catch (err) {
     setError("Google login error: " + err.message);
   } finally {
     setLoadingGoogle(false);
   }
 };```
Steven
21 Aug, 2025, 14:33

FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting).

Steven
21 Aug, 2025, 14:37

Please follow the docs for how to implement oauth and then share your app.json, updated code, and the output of the deepLink

Axistro
21 Aug, 2025, 14:45

Change linking url to appwrite-callback-projectid

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