Authentication Get Started - tuarua/Firebase-ANE GitHub Wiki
The contents of this page are based on the original Firebase Documentation
You can use Firebase Authentication to allow users to sign in to your app using one or more sign-in methods, including email address and password sign-in, and federated identity providers such as Google Sign-in and Facebook Login. This tutorial gets you started with Firebase Authentication by showing you how to add email address and password sign-in to your app.
Add Authentication to your app
import com.tuarua.firebase.AuthANE;
private var auth:AuthANE;
auth = AuthANE.auth;
Sign up new users
Create a form that allows new users to register with your app using their email address and a password. When a user completes the form, validate the email address and password provided by the user, then pass them to the createUserWithEmailAndPassword() method:
auth.createUserWithEmailAndPassword("[email protected]", "password", onNewUser);
Sign in existing users
auth.signIn(new EmailAuthCredential("[email protected]", "password"), onSignedIn);
Get user information
var user:FirebaseUser = auth.currentUser;
trace(user.displayName);
trace(user.email);
trace(user.photoUrl);