Jump to: navigation, search

Linking and Unlinking Firebase Authentication Providers

66 bytes added, 17:33, 30 August 2017
no edit summary
Once the credentials have been obtained, the FirebaseUser object for the current user (in this case the anonymous account) is obtained and the linkWithCredential() method of that object called, passing through the credentials for the new email and password account. If an error is encountered, the user is notified via a Toast message. A successful linking operation, on the other hand, will trigger a call to the authentication state listener which will update the user interface with the user’s email address and switch the soft button back to anonymous sign-in mode.
== Testing the Project ==
The provider ID takes the form of a string which represents the authentication provider used to create the account (“firebase”, “”, “”, “”, “password” etc). When identifying the authentication providers assigned to a user, there will always be a “firebase” entry regardless of which other providers have also been configured. A user that only has an email/password based account will, for example, return two UserInfo objects within the provider data containing provider ids of “firebase” and “password” respectively. It is not possible to unlink the “firebase” provider.

Navigation menu