Challenge - 5 Problems
Firebase Custom Token Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ service_behavior
intermediate2:00remaining
What happens when a Firebase custom token expires?
You create a Firebase custom authentication token with a 1-hour expiration. What happens if a client tries to use this token after it expires?
Attempts:
2 left
💡 Hint
Think about how tokens maintain security by limiting their valid time.
✗ Incorrect
Firebase custom tokens expire after their set time. Clients must get a new token to continue authenticating. Expired tokens are rejected to keep access secure.
❓ Configuration
intermediate2:00remaining
Which Firebase Admin SDK method creates a custom token?
You want to generate a custom authentication token for a user with ID 'user123'. Which Firebase Admin SDK method correctly creates this token?
Attempts:
2 left
💡 Hint
Look for the method that explicitly mentions 'create' and 'CustomToken'.
✗ Incorrect
The Firebase Admin SDK uses createCustomToken(uid) to generate a custom token for a user ID. Other methods do not exist or serve different purposes.
❓ security
advanced2:00remaining
What is the best practice to secure the private key used for signing Firebase custom tokens?
You have a private key to sign Firebase custom tokens. Which practice best protects this key?
Attempts:
2 left
💡 Hint
Think about who should have access to sensitive keys and where they should be stored.
✗ Incorrect
Private keys must be kept secret and stored securely, such as in environment variables or secret managers. Exposing keys in client code or public repos risks compromise.
❓ Architecture
advanced2:00remaining
How should you architect a system to issue Firebase custom tokens for users authenticated by an external system?
You have an external user database and want to allow those users to access Firebase services using custom tokens. What architecture best supports this?
Attempts:
2 left
💡 Hint
Consider where sensitive operations like token signing should happen.
✗ Incorrect
A secure backend service should verify external users and generate custom tokens. This keeps private keys safe and ensures only valid users get tokens.
🧠 Conceptual
expert2:00remaining
What is the main difference between Firebase custom tokens and ID tokens?
Firebase uses both custom tokens and ID tokens in authentication. What is the key difference between them?
Attempts:
2 left
💡 Hint
Think about who creates each token and when they are used.
✗ Incorrect
Custom tokens are created by your backend to sign in users. After sign-in, Firebase issues ID tokens to the client to authorize requests. They serve different roles.