It’s not entirely clear how to use existing auth methods with Firebase. We should document how to do it!
From my outdated Github + Firebase auth guide:
import firebase from 'firebase';
const access_token = /* auth result */
const credential = firebase.auth.GithubAuthProvider.credential(access_token);
const user = await firebase.auth().signInAndRetrieveDataWithCredential(credential);
Related: https://twitter.com/childishludino/status/1258106926333857794?s=20
Concerns with the following approach:
Just an update, I recently tested Firebase Google auth with
expo-auth-session
, I got it working like this:expo install firebase expo-auth-session
, ensure you are using expo-auth-session@^1.2.1 or greater.responseType: ResponseType.Token
usePKCE: false
which is required for implicit authMy completed code looked like:
Pressing the button (on web first) should open the popup and give you an error:
https://localhost:19006
https://auth.expo.io
https://localhost:19006
WebBrowser.maybeCompleteAuthSession();
from the root URL of your app.https://auth.expo.io/@yourname/your-app
Return to your app, pressing “Login” should now work as expected.