0
0
Firebasecloud~5 mins

Custom authentication tokens in Firebase - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a custom authentication token in Firebase?
A custom authentication token is a secure token created by your server to sign in users with Firebase Authentication when you want to manage your own user identities.
Click to reveal answer
beginner
Why would you use custom authentication tokens instead of Firebase's built-in sign-in methods?
You use custom tokens when you have your own user system or want to integrate Firebase Authentication with existing authentication methods outside Firebase.
Click to reveal answer
intermediate
Which Firebase Admin SDK method is used to create a custom authentication token?
The method is createCustomToken(uid, additionalClaims) where uid is the user ID and additionalClaims are optional extra data.
Click to reveal answer
beginner
What information must you include when creating a custom authentication token?
You must include a unique user ID (uid) and can optionally add extra claims like roles or permissions.
Click to reveal answer
beginner
How does a client use a custom authentication token to sign in?
The client receives the token from your server and calls signInWithCustomToken(token) to authenticate with Firebase.
Click to reveal answer
What is the main purpose of Firebase custom authentication tokens?
ATo replace Firebase Realtime Database
BTo create Firebase projects
CTo store user data securely
DTo sign in users with your own authentication system integrated with Firebase
Which Firebase SDK is used to create custom authentication tokens?
AFirebase Storage SDK
BFirebase Admin SDK
CFirebase Client SDK
DFirebase Hosting SDK
What is required to create a custom token?
AUser's email only
BUser's password
CA unique user ID (uid)
DFirebase API key
How does the client authenticate with Firebase using a custom token?
ABy calling signInWithCustomToken(token)
BBy calling signInWithEmailAndPassword
CBy calling createUserWithEmailAndPassword
DBy calling signOut
Can you add extra information like user roles in a custom token?
AYes, as additional claims
BNo, tokens only contain user ID
CYes, but only in the client SDK
DNo, Firebase does not support extra data
Explain how custom authentication tokens work in Firebase and why you might use them.
Think about how your server and client communicate to authenticate users.
You got /4 concepts.
    Describe the steps to create and use a custom authentication token in Firebase.
    Focus on server token creation and client sign-in.
    You got /4 concepts.