LinkAndRetrieveDataWithCredentialAsync

For example, a Facebook login access token, a Twitter token/token-secret pair. Status will be an error if the token is invalid, expired, or otherwise not accepted by the server as well as if the given 3rd party user id is already linked with another user account or if the current user is already linked with another id from the same provider.

ReauthenticateAndRetrieveDataAsync

Some APIs (for example, UpdatePasswordAsync, DeleteAsync) require that the token used to invoke them be from a recent login attempt. This API takes an existing credential for the user and retrieves fresh tokens, ensuring that the operation can proceed. Developers can call this method prior to calling UpdatePasswordAsync() to ensure success.

Returns an error if the existing credential is not for this user or if sign-in with that credential failed. The user should remain signed in even if this method failed. If the developer had held a reference to that user, the reference will continue to be valid after this operation.

TokenAsync

If called by two threads simultaneously, GetToken can return the same pending Future twice. This creates problems if both threads try to set the OnCompletion callback, unaware that there's another copy. GetTokenThreadSafe returns a proxy to the Future if it's still pending, allowing each proxy to have their own callback.

UpdatePasswordAsync

For an account linked to an Identity Provider (IDP) with no password, this will result in the account becoming an email/password-based account while maintaining the IDP link. May fail if the password is invalid, if there is a conflicting email/password-based account, or if the token has expired. To retrieve fresh tokens, call ReauthenticateAsync.

UpdatePhoneNumberCredentialAsync

This is useful when a user wants to change their phone number. It is a shortcut to calling Unlink(phone_credential.provider().c_str()) and then LinkWithCredential(phone_credential). credential must have been created with PhoneAuthProvider.