FirebaseUI-Android
FirebaseUI-Android copied to clipboard
Provide FlowParameters for linking credentials to authenticated users
The SignInIntentBuilder.enableAnonymousUsersAutoUpgrade()
provides a configuration for linking credentials to an anonymous user. It would be nice to utilize this implementation to link credentials to authenticated users as well. This is especially useful for adding a phone number to an existing users or vise versa.
This might relate to #309.
Steps to reproduce:
- Start
AuthUI
with two providers (e.g. Google and Phone) - Sign in with Google
- Repeat 1.
- Sign in with Phone
Observed Results:
- A new user was created with the phone number provided in 4.
Expected Results:
- The phone number was added to the user signed in in 2.
Relevant Code:
From AuthOperationManager.java
public Task<AuthResult> signInAndLinkWithCredential(@NonNull FirebaseAuth auth,
@NonNull FlowParameters flowParameters,
@NonNull AuthCredential credential) {
if (canUpgradeAnonymous(auth, flowParameters)) {
return auth.getCurrentUser().linkWithCredential(credential);
} else {
return auth.signInWithCredential(credential);
}
}
public boolean canUpgradeAnonymous(FirebaseAuth auth, FlowParameters flowParameters) {
return flowParameters.isAnonymousUpgradeEnabled() && auth.getCurrentUser() != null &&
auth.getCurrentUser().isAnonymous();
}
Hi, thanks for the feature request! I've added this to our internal tracking (b/162980103).
Hello @sam-gc, Have you any news about this feature ? Best Regards,
Hi @FanciROS, unfortunately no updates for now
Hi, any update on this? I'd be great to use Auth UI flow for Linking accounts via linkWithCredential
I saw this is already solved here 309 @samtstern seems this issue has been resolved perfectly great by @SUPERCILEX and still not avialble officially. Wouldn't it make sense to make the improvement avialble ? Even if IOS version is not alligned with this feature it doesn't make sense to hold the feature any longer for android users, specially since this has been avialble since 2017 or even before. Having the feature avialable will also encourage IOS team to deliver the feature sooner.... otherwise we will be waiting and waiting for an already avialble feature that is super helpful and mostly needed. Thanks in advance @samtstern , and also thanks a lot @SUPERCILEX for developing this super useful feature!