Google Sign In Get Started
The contents of this page are based on the original Firebase Documentation
You can let your users authenticate with Firebase using their Google Accounts by integrating Google Sign-In into your app.
- If you haven't yet connected your app to your Firebase project, do so from the Firebase Console.
- If you haven't yet specified your app's SHA-1 fingerprint, do so from the Settings page of the Firebase console. See Authenticating Your Client for details on how to get your app's SHA-1 fingerprint. (Android only)
- Enable Google Sign-In in the Firebase Console:
- In the Firebase console, open the Auth section.
- On the Sign in method tab, enable the Google sign-in method and click Save.
import com.tuarua.google.GoogleSignInANE;
import com.tuarua.google.signin.events.GoogleSignInEvent;
private var googleSignIn:GoogleSignInANE;
googleSignIn = GoogleSignInANE.googleSignIn;
googleSignIn.addEventListener(GoogleSignInEvent.SIGN_IN, onGoogleSignIn);
googleSignIn.addEventListener(GoogleSignInEvent.ERROR, onGoogleSignIn);
googleSignIn.signIn();
In the onGoogleSignIn method, we pass this GoogleAuthCredential to auth.signIn():
private function onGoogleSignIn(event:GoogleSignInEvent):void {
if (event.error) {
statusLabel.text = "Google Sign In error: " + event.error.errorID + " : " + event.error.message;
return;
}
auth.signIn(event.credential, onSignedIn);
}
After a user signs in for the first time, a new user account is created and linked to the credentials—that is, the user name and password, phone number, or auth provider information—the user signed in with. This new account is stored as part of your Firebase project, and can be used to identify a user across every app in your project, regardless of how the user signs in.
To sign out a user, call signOut()
auth.signOut();
Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.
Project setup
Analytics
Authentication
Dynamic Links
Google Sign In
Firestore
- Configuring the ANE
- Get Started
- Add and Manage Data
- Query Data
- Get Data
- Get Realtime Updates
- Perform Simple and Compound Queries
- Order and Limit Data
- Paginate Data
Messaging
One Signal
Performance
Remote Config
Storage
- Configuring the ANE
- Get Started
- Create a Reference
- Upload Files
- Download Files
- Use File Metadata
- Delete Files
Crashlytics
Vision
- Detect faces
- Scan barcodes
- Label images
- Recognize landmarks
- Natural Language
- Custom Models
External Links