Anonymous user and account conversion to permanent account
Hi there
Is there a way in which AuthUI supports the conversion of a anonymous account to a permanent one (one of the supplied auth providers)
As stated in the documentation and as I understand it, one must use the linkWithCredential method instead of the "normal" signInWith flow.
Can this be done with the current AuthUI version somehow?
Hi Daniel,
We don't have any direct support in FirebaseUI for upgrading anonymous accounts to an account backed by an authentication method just yet. You can do it directly with the Firebase Auth APIs, see here in the section "Convert an anonymous account to a permanent account".
I'll leave this issue open as a feature enhancement request; we can likely handle this automatically within FirebaseUI if an existing anonymous user is present in auth.getCurrentUser() when sign in occurs during the authentication flow.
Hi @iainmcgin - thanks for your reply (and considering it as a feature enhancement :) )
I've read through the documentation you mentioned - maybe you can answer me this: Is there a way to get the AuthCredential object from AuthUI which was used by the user to sign-in? As I'm reading the docs, without this object instantiated with the users credentials there's not way to link accounts...
Ah, we have a slight problem here after discussing this with some colleagues. There is deliberately no way to get back an AuthCredential from an existing user, to avoid potentially leaking credentials. So, the linking of the authentication method to the anonymous account would have to occur within Firebase UI if you are using the library. I'll take a look at this next week to get you unblocked ASAP.
Great - looking forward to hearing from you 👍 (And thanks a lot!)
Facing similar case. My app uses default anonymous login to provide a frictionless experience while being able to store user data. Log-in (non anonymously) is a secondary optional feature if the user wants to save his data between devices or access specific features. So my app doesn't really have a true logout status and instead rely on anon/non-anon statuses.
1 - Simple scenario;
An anonymous user with some local data decides to sign up with X provider (new account). In this case FirebaseUI creates a new user instead of linking the new credentials to the current anonymous user. Moreover the new user is loged in without a warning, so the anon user is lost for ever. ¿Wouldn't be a good default behaviour to try to link the credentials first? In case an account for those credentials already exists linkWithCredential will return an exception which can be handled as follow (see scenario 2)
2 - Complex scenario: An anonymous user tries to sign in (to an existing account). In this scenario we have 2 users and I guess it should be managed by the developer. So some sort of callback/result.
I see how this is problematic due to the potential complexity of second case, but at least the 1st case can be solved very easily by trying to link 1st new credentials when an anonymous user is in.
@iainmcgin Any updates on this? I'm blocked on the same issue and wondering if I will need to fork FirebaseUI to proceed...
~~Same issue here ! Waiting for a fix...~~ In fact, I'm using firebase oauth for a web app, so I'll post in the relevant github project.
I'm quite keen on this feature too.
Looking forward for this enhancement on both Android and iOS
Has this feature been implemented in the 0.5.1 release? I'm also really looking forward for this.
@shalama this has not been implemented yet. It's something we are looking into for future releases though.
You can see exactly what changes with each release by visiting the release notes: https://github.com/firebase/FirebaseUI-Android/releases
+1 for the feature request
Hi @iainmcgin , we have the same feature requirement. Does team have any workaround for this? Hope you can have a response :)
@bobshao Unfortunately, there aren't any workarounds as mentioned above, but I'm going to be able to work on #309 again so I'm hoping for it to cut FirebaseUI v1.1.0 which will be coming out soon.
Thanks very much for your quick response :) @SUPERCILEX
It looks like 1.1.0 is shaping up at #510. Will #309 be included in the version?
@curiousily this will not be making it into the 1.1.0 release due to cross-platform issues. We don't have an implementation on iOS yet.
@samtstern thanks for the info. Will love to hear any plans concerning when this will be merged.
Any progress on this? This feature would be great for an app I'm working on.
@percula #309 is ready to be merged, but it's waiting on https://github.com/firebase/FirebaseUI-iOS/issues/139.