Search code examples
react-nativeoauth-2.0expogoogle-oauthexpo-go

how can I use google oauth in expo go app?


I'm trying to implement google auth provider in my expo app (android for now), at the moment I'm developing it using Expo Go for convenience. The problem is I have to provide the apps SHA-1 certificate to google in order for it to work. The question is, can I use Expo Go with google auth somehow? or do I need to create a standalone build and create the key to sign it?


Solution

  • So I know your post was forever ago, but I'm going to post this for anyone else looking into it. After 2 days of attempts and research it's not possible but not because of the fingerprint.

    When using expo go your app is considered a web application, so you need to set up and test using the web application token not android app. But then this creates an entirely new issue, the redirect url using expo go will never be able to be authorized, which means you have to host using a service like ngrok (there may be other options that allow you to host exp:// with a proper domain that is allowed for redirect but I had 0 luck finding one) i attempted a few options before I finally landed on this solution but what I ended up doing in the end was using ngrok, and then just doing my testing in the browser, setting up the auth through the browser using the ngrok redirect and it works flawlessly, then I disabled the auth for the rest of my build until I was finished, re enabled it and changed the token to an android token built and it worked great.

    Definitely a pain in the ass, but it did the trick and allowed me to test and set up auth while in a development environment.

    Again I know this won't be helpful for you as you likely already found a solution, but for anyone else searching for a solution here ya go.

    If you happened to find a different, possibly better solution I'd love to hear it because it's not the most ideal fix

    EDIT: I found another, better solution using the web token here Expo Go with Google/Facebook OAuth - auth.expo.io login screen - "Not Found"