Challenge - 5 Problems
Anonymous Authentication Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate2:00remaining
What happens after anonymous sign-in in Firebase?
When a user signs in anonymously using Firebase Authentication, what is the state of the user's identity immediately after sign-in?
Firebase
firebase.auth().signInAnonymously().then(userCredential => {
console.log(userCredential.user.uid);
});Attempts:
2 left
💡 Hint
Think about what anonymous means in authentication.
✗ Incorrect
Anonymous sign-in creates a unique user ID without requiring email or password. This allows temporary access without user credentials.
❓ security
intermediate2:00remaining
What is a security risk of anonymous authentication?
Which of the following is a potential security risk when using Firebase anonymous authentication in an app?
Attempts:
2 left
💡 Hint
Consider what happens if the anonymous user identity is lost.
✗ Incorrect
Anonymous users have a unique ID stored locally. If the app is uninstalled, the ID is lost and data linked to that ID is inaccessible.
❓ Configuration
advanced2:00remaining
Which Firebase rule allows anonymous users to read data but not write?
Given Firebase Realtime Database rules, which rule snippet correctly allows anonymous users to read data but prevents them from writing?
Attempts:
2 left
💡 Hint
Check the conditions for read and write permissions based on auth state.
✗ Incorrect
Rule B allows any authenticated user to read, but only non-anonymous users to write. This matches the requirement.
❓ Architecture
advanced2:00remaining
How to preserve user data when upgrading anonymous users?
What is the recommended approach to keep user data when an anonymous Firebase user upgrades to a permanent account?
Attempts:
2 left
💡 Hint
Think about how Firebase supports account linking.
✗ Incorrect
linkWithCredential() merges the anonymous user with the permanent account, preserving data and user ID.
🧠 Conceptual
expert2:00remaining
What is the behavior of Firebase anonymous authentication token expiration?
Which statement correctly describes the token expiration behavior for Firebase anonymous authentication users?
Attempts:
2 left
💡 Hint
Consider how Firebase handles token lifecycle for all users.
✗ Incorrect
Firebase issues ID tokens valid for one hour for all users, including anonymous ones, and the SDK refreshes them automatically.