0
0
Firebasecloud~20 mins

Linking multiple providers in Firebase - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Firebase Multi-Provider Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What happens when you link multiple providers to a Firebase user?

In Firebase Authentication, what is the main effect of linking multiple providers (like Google and Facebook) to a single user account?

AEach provider creates a separate user account with isolated data.
BThe user can sign in using any linked provider and access the same account data.
CLinking providers merges user data from all providers automatically without user consent.
DLinking providers disables sign-in from the original provider.
Attempts:
2 left
💡 Hint

Think about how linking providers affects user sign-in options.

Configuration
intermediate
2:00remaining
Which Firebase method links a new provider to an existing user?

Given an authenticated Firebase user, which method correctly links a new OAuth provider credential to their account?

Firebase
const credential = firebase.auth.GoogleAuthProvider.credential(idToken);
// User is already signed in
// Which method links the credential to the user?
Afirebase.auth().currentUser.linkWithCredential(credential)
Bfirebase.auth().linkUserWithCredential(credential)
Cfirebase.auth().currentUser.signInWithCredential(credential)
Dfirebase.auth().linkCredentialToUser(credential)
Attempts:
2 left
💡 Hint

Check the Firebase user object methods for linking credentials.

Architecture
advanced
2:30remaining
How to design user data storage for multiple linked providers?

You want to store user profile data in Firestore for users who sign in with multiple linked providers. What is the best practice for structuring this data?

AStore one user document per Firebase UID with a nested field listing all linked providers.
BCreate separate user documents for each provider linked to the same email.
CStore user data only under the first provider used to sign up.
DDuplicate user data in multiple collections, one per provider.
Attempts:
2 left
💡 Hint

Consider how Firebase UID relates to user identity across providers.

security
advanced
2:30remaining
What security risk arises if you do not verify provider emails before linking?

When linking multiple providers to a Firebase user, what risk occurs if you do not verify that the email addresses from providers match and are verified?

AUsers will be unable to sign in with any provider after linking.
BFirebase automatically prevents any security risks without verification.
CAn attacker could link their provider account to another user's Firebase account and gain access.
DThe linked providers will lose their authentication tokens.
Attempts:
2 left
💡 Hint

Think about what happens if two accounts share the same email but are not verified.

service_behavior
expert
3:00remaining
What is the Firebase user state after unlinking a provider?

After unlinking a provider from a Firebase user who has multiple linked providers, what is the state of the user account?

AThe user loses access to all linked providers until re-linked.
BThe user is signed out immediately and must sign in again.
CThe user account is deleted if any provider is unlinked.
DThe user remains signed in and can sign in with remaining linked providers.
Attempts:
2 left
💡 Hint

Consider what unlinking a provider means for the user's authentication options.