question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Authenticate with google doesn't redirect back to app

See original GitHub issue

Authenticate with google(on Android) redirects to google.com not to app itself.
Can be reproduced with exp.host@notbrent/native-component-list google auth button.

url redirected: https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=host.exp.exponent%3A%2Foauthredirect&client_id=733666839474-29hiep386cbm9u262lvgjf96uvq8pglu.apps.googleusercontent.com&response_type=code&state=hZ3f26YcYdrzfQLpvWRm7w&scope=profile%20email&code_challenge=5xHtVcrqLe_hCKOnj_rLYgjSRZut98C8O3ATsMfS8j8&code_challenge_method=S256

Exponent.Google.logInAsync({
    behavior: 'web',
    androidClientId: '733666839474-29hiep386cbm9u262lvgjf96uvq8pglu.apps.googleusercontent.com',
    iosClientId: '733666839474-l0s6c0d1m4f844cin668iilgears8b2n.apps.googleusercontent.com',
    androidStandaloneAppClientId: '733666839474-g2i9bjpet38je9159v6aq2s822pk2rop.apps.googleusercontent.com',
    iosStandaloneAppClientId: '1052406890180-eo50cdr1fnqu0kgpg3rh8hvchb49vf98.apps.googleusercontent.com',
    scopes: ['profile', 'email'],
  })
  .then((result) => {
    if (result.type === 'success') {
      return path.success({ accessToken: result });
    }
    return path.failed({ accessToken: err });
  })
  .catch(err => path.failed({ accessToken: err }));

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:21 (5 by maintainers)

github_iconTop GitHub Comments

8reactions
MonasteryJohncommented, Feb 9, 2019

Not sure if this will help anyone else, but I found that I would run into this problem on a real device if my android package name had a mix of upper and lower case letters.

For example, com.company.AppName would cause the redirect to google.com, whereas com.company.appname would be perfectly happy.

In my case it made no difference whether the Google oAuth credential was set to the same upper case version or not, it just didn’t work that way at all.’

@terribleben Is there any other solution to this problem? Still experiencing with sdk 32 on S9.

1reaction
janicduplessiscommented, Mar 3, 2017

Are you testing on a real device or the simulator? Also what browser is installed on it? I’m asking because on the Android simulator the installed browser is usually WebviewBrowser and it doesn’t support app scheme redirects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google apps fail to redirect properly after authentication
Hi,. I am facing several issues related to redictering back to a page after a sign in request. ... After entering my password...
Read more >
Google Login doesn't redirect back to app - Auth0 Community
Everything seems to work as expected, but the redirection part. after the login is not returning back to my app. and go straight...
Read more >
Google Login doesn't redirect back to app - MSDN
First: OPEN THE NATIVE BROSER · Seccond: com. · Next, When I select an account appear this page with a label "Espera un...
Read more >
After logging in with Google it doesn't redirect me back to my ...
My app logs me in with Google on the Web version of it, but when I export it to an Android device the...
Read more >
Sign In with Google Tutorial: Redirect Back to App - Passport.js
Redirect Back to App ... In the previous section, you added session support to the app in order to maintain state when redirecting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found