firebase::auth

Firebase Authentication API.

Summary

Firebase Authentication provides backend services to securely authenticate users. It can authenticate users using passwords and federated identity provider credentials, and it can integrate with a custom auth backend.

Enumerations

AuthError{
  kAuthErrorNone = 0,
  kAuthErrorUnimplemented = -1,
  kAuthErrorFailure = 1,
  kAuthErrorInvalidCustomToken,
  kAuthErrorCustomTokenMismatch,
  kAuthErrorInvalidCredential,
  kAuthErrorUserDisabled,
  kAuthErrorAccountExistsWithDifferentCredentials,
  kAuthErrorOperationNotAllowed,
  kAuthErrorEmailAlreadyInUse,
  kAuthErrorRequiresRecentLogin,
  kAuthErrorCredentialAlreadyInUse,
  kAuthErrorInvalidEmail,
  kAuthErrorWrongPassword,
  kAuthErrorTooManyRequests,
  kAuthErrorUserNotFound,
  kAuthErrorProviderAlreadyLinked,
  kAuthErrorNoSuchProvider,
  kAuthErrorInvalidUserToken,
  kAuthErrorUserTokenExpired,
  kAuthErrorNetworkRequestFailed,
  kAuthErrorInvalidApiKey,
  kAuthErrorAppNotAuthorized,
  kAuthErrorUserMismatch,
  kAuthErrorWeakPassword,
  kAuthErrorNoSignedInUser,
  kAuthErrorApiNotAvailable,
  kAuthErrorExpiredActionCode,
  kAuthErrorInvalidActionCode,
  kAuthErrorInvalidMessagePayload,
  kAuthErrorInvalidPhoneNumber,
  kAuthErrorMissingPhoneNumber,
  kAuthErrorInvalidRecipientEmail,
  kAuthErrorInvalidSender,
  kAuthErrorInvalidVerificationCode,
  kAuthErrorInvalidVerificationId,
  kAuthErrorMissingVerificationCode,
  kAuthErrorMissingVerificationId,
  kAuthErrorMissingEmail,
  kAuthErrorMissingPassword,
  kAuthErrorQuotaExceeded,
  kAuthErrorRetryPhoneAuth,
  kAuthErrorSessionExpired,
  kAuthErrorAppNotVerified,
  kAuthErrorAppVerificationFailed,
  kAuthErrorCaptchaCheckFailed,
  kAuthErrorInvalidAppCredential,
  kAuthErrorMissingAppCredential,
  kAuthErrorInvalidClientId,
  kAuthErrorInvalidContinueUri,
  kAuthErrorMissingContinueUri,
  kAuthErrorKeychainError,
  kAuthErrorMissingAppToken,
  kAuthErrorMissingIosBundleId,
  kAuthErrorNotificationNotForwarded,
  kAuthErrorUnauthorizedDomain,
  kAuthErrorWebContextAlreadyPresented,
  kAuthErrorWebContextCancelled,
  kAuthErrorDynamicLinkNotActivated,
  kAuthErrorCancelled,
  kAuthErrorInvalidProviderId,
  kAuthErrorWebInternalError,
  kAuthErrorWebStorateUnsupported,
  kAuthErrorTenantIdMismatch,
  kAuthErrorUnsupportedTenantOperation,
  kAuthErrorInvalidLinkDomain,
  kAuthErrorRejectedCredential,
  kAuthErrorPhoneNumberNotFound,
  kAuthErrorInvalidTenantId,
  kAuthErrorMissingClientIdentifier,
  kAuthErrorMissingMultiFactorSession,
  kAuthErrorMissingMultiFactorInfo,
  kAuthErrorInvalidMultiFactorSession,
  kAuthErrorMultiFactorInfoNotFound,
  kAuthErrorAdminRestrictedOperation,
  kAuthErrorUnverifiedEmail,
  kAuthErrorSecondFactorAlreadyEnrolled,
  kAuthErrorMaximumSecondFactorCountExceeded,
  kAuthErrorUnsupportedFirstFactor,
  kAuthErrorEmailChangeNeedsVerification
}
enum
All possible error codes from asynchronous calls.

Typedefs

UIParent typedef
void *
A void pointer for stub classes.

Classes

firebase::auth::Auth

Firebase authentication object.

firebase::auth::AuthStateListener

Listener called when there is a change in the authentication state.

firebase::auth::Credential

Authentication credentials for an authentication provider.

firebase::auth::EmailAuthProvider

Use email and password to authenticate.

firebase::auth::FacebookAuthProvider

Use an access token provided by Facebook to authenticate.

firebase::auth::FederatedAuthProvider

Used to authenticate with Federated Auth Providers.

firebase::auth::FederatedOAuthProvider

Authenticates with Federated OAuth Providers via the firebase::auth::Auth and firebase::auth::User classes.

firebase::auth::GameCenterAuthProvider

GameCenter (Apple) auth provider.

firebase::auth::GitHubAuthProvider

Use an access token provided by GitHub to authenticate.

firebase::auth::GoogleAuthProvider

Use an ID token and access token provided by Google to authenticate.

firebase::auth::IdTokenListener

Listener called when there is a change in the ID token.

firebase::auth::MicrosoftAuthProvider

Use an access token provided by Microsoft to authenticate.

firebase::auth::OAuthProvider

OAuth2.0+UserInfo auth provider (OIDC compliant and non-compliant).

firebase::auth::PhoneAuthCredential

Wraps phone number and verification information for authentication purposes.

firebase::auth::PhoneAuthProvider

Use phone number text messages to authenticate.

firebase::auth::PlayGamesAuthProvider

Use a server auth code provided by Google Play Games to authenticate.

firebase::auth::TwitterAuthProvider

Use a token and secret provided by Twitter to authenticate.

firebase::auth::User

Firebase user account object.

firebase::auth::UserInfoInterface

Interface implemented by each identity provider.

firebase::auth::YahooAuthProvider

Use an access token provided by Yahoo to authenticate.

Structs

firebase::auth::AdditionalUserInfo

Additional user data returned from an identity provider.

firebase::auth::AuthResult

The result of operations that can affect authentication state.

firebase::auth::FederatedOAuthProviderData

Contains information to identify an OAuth povider.

firebase::auth::FederatedProviderData

Contains information required to authenticate with a third party provider.

firebase::auth::PhoneAuthOptions

Options object for configuring phone validation flows in PhoneAuthProvider.

firebase::auth::UserMetadata

Metadata corresponding to a Firebase user.

Enumerations

AuthError

 AuthError

All possible error codes from asynchronous calls.

For error details, call Future::ErrorMessage().

Properties
kAuthErrorAccountExistsWithDifferentCredentials

Indicates an account already exists with the same email address but using different sign-in credentials.

Account linking is required. Caused by "Sign in with credential" methods.

kAuthErrorAdminRestrictedOperation

Indicates that a request was made that is restricted to administrators only.

kAuthErrorApiNotAvailable

This can happen when certain methods on App are performed, when the auth API is not loaded.

kAuthErrorAppNotAuthorized

Indicates the App is not authorized to use Firebase Authentication with the provided API Key.

Common error code for all API Methods. On Android this error should no longer occur (as of 2016 v3). Common error code for all API Methods.

kAuthErrorAppNotVerified

Indicates that the app could not be verified by Firebase during phone number authentication.

kAuthErrorAppVerificationFailed

Indicates a general failure during the app verification flow.

kAuthErrorCancelled

Indicates that the operation was cancelled.

kAuthErrorCaptchaCheckFailed

Indicates that the reCAPTCHA token is not valid.

kAuthErrorCredentialAlreadyInUse

Indicates an attempt to link with a credential that has already been linked with a different Firebase account.

Caused by "Set account info" methods.

kAuthErrorCustomTokenMismatch

Indicates the service account and the API key belong to different projects.

Caused by "Bring your own auth" methods.

kAuthErrorDynamicLinkNotActivated

Indicates that Dynamic Links in the Firebase Console is not activated.

kAuthErrorEmailAlreadyInUse

Indicates the email used to attempt a sign up is already in use.

Caused by "Set account info" methods.

kAuthErrorEmailChangeNeedsVerification

Indicates that a second factor users attempted to change their email with updateEmail instead of verifyBeforeUpdateEmail.

kAuthErrorExpiredActionCode

Indicates the out-of-band authentication code is expired.

kAuthErrorFailure

This indicates an internal error.

Common error code for all API Methods.

kAuthErrorInvalidActionCode

Indicates the out-of-band authentication code is invalid.

kAuthErrorInvalidApiKey

Indicates an invalid API key was supplied in the request.

For Android these should no longer occur (as of 2016 v3). Common error code for all API Methods.

kAuthErrorInvalidAppCredential

Indicates that an invalid APNS device token was used in the verifyClient request.

kAuthErrorInvalidClientId

Indicates that the clientID used to invoke a web flow is invalid.

kAuthErrorInvalidContinueUri

Indicates that the domain specified in the continue URI is not valid.

kAuthErrorInvalidCredential

Indicates the IDP token or requestUri is invalid.

Caused by "Sign in with credential" methods.

kAuthErrorInvalidCustomToken

Indicates a validation error with the custom token.

This error originates from "bring your own auth" methods.

kAuthErrorInvalidEmail

Indicates an invalid email address.

Caused by "Sign in with password" methods.

kAuthErrorInvalidLinkDomain

Indicates that an FDL domain used for an out of band code flow is either not configured or is unauthorized for the current project.

kAuthErrorInvalidMessagePayload

Indicates that there are invalid parameters in the payload during a "send password reset email" attempt.

kAuthErrorInvalidMultiFactorSession

Indicates that a second factor challenge request was made containing an invalid proof of first factor sign-in.

kAuthErrorInvalidPhoneNumber

Indicates that an invalid phone number was provided.

This is caused when the user is entering a phone number for verification.

kAuthErrorInvalidProviderId

Indicates that the provider id given for the web operation is invalid.

kAuthErrorInvalidRecipientEmail

Indicates that the recipient email is invalid.

kAuthErrorInvalidSender

Indicates that the sender email is invalid during a "send password reset email" attempt.

kAuthErrorInvalidTenantId

Indicates that a request was made to the backend with an invalid tenant ID.

kAuthErrorInvalidUserToken

Indicates user's saved auth credential is invalid, the user needs to sign in again.

Caused by requests with an STS id token.

kAuthErrorInvalidVerificationCode

Indicates that an invalid verification code was used in the verifyPhoneNumber request.

kAuthErrorInvalidVerificationId

Indicates that an invalid verification ID was used in the verifyPhoneNumber request.

kAuthErrorKeychainError

Indicates an error occurred while attempting to access the keychain.

Common error code for all API Methods.

kAuthErrorMaximumSecondFactorCountExceeded

Indicates that the user has reached the maximum number of allowed second factors and is attempting to enroll another one.

kAuthErrorMissingAppCredential

Indicates that the APNS device token is missing in the verifyClient request.

kAuthErrorMissingAppToken

Indicates that the APNs device token could not be obtained.

The app may not have set up remote notification correctly, or may have failed to forward the APNs device token to FIRAuth if app delegate swizzling is disabled.

kAuthErrorMissingClientIdentifier

Indicates that a request was made to the backend without a valid client identifier.

kAuthErrorMissingContinueUri

Indicates that a continue URI was not provided in a request to the backend which requires one.

kAuthErrorMissingEmail

Indicates that an email address was expected but one was not provided.

kAuthErrorMissingIosBundleId

Indicates that the iOS bundle ID is missing when an iOS App Store ID is provided.

kAuthErrorMissingMultiFactorInfo

Indicates that a second factor challenge request was made where a second factor identifier was not provided.

kAuthErrorMissingMultiFactorSession

Indicates that a second factor challenge request was made without proof of a successful first factor sign-in.

kAuthErrorMissingPassword

Represents the error code for when an application attempts to create an email/password account with an empty/null password field.

kAuthErrorMissingPhoneNumber

Indicates that a phone number was not provided during phone number verification.

kAuthErrorMissingVerificationCode

Indicates that the phone auth credential was created with an empty verification code.

kAuthErrorMissingVerificationId

Indicates that the phone auth credential was created with an empty verification ID.

kAuthErrorMultiFactorInfoNotFound

Indicates that the user does not have a second factor matching the provided identifier.

kAuthErrorNetworkRequestFailed

Indicates a network error occurred (such as a timeout, interrupted connection, or unreachable host).

These types of errors are often recoverable with a retry. Common error code for all API Methods.

kAuthErrorNoSignedInUser

Internal api usage error code when there is no signed-in user and getAccessToken is called.

kAuthErrorNoSuchProvider

Indicates an attempt to unlink a provider that is not linked.

Caused by "Link credential" methods.

kAuthErrorNone

Success.

kAuthErrorNotificationNotForwarded

Indicates that the app fails to forward remote notification to FIRAuth.

kAuthErrorOperationNotAllowed

Indicates the administrator disabled sign in with the specified identity provider.

Caused by "Set account info" methods.

kAuthErrorPhoneNumberNotFound

Indicates that the phone number provided in the MFA sign in flow to be verified does not correspond to a phone second factor for the user.

kAuthErrorProviderAlreadyLinked

Indicates an attempt to link a provider to which the account is already linked.

Caused by "Link credential" methods.

kAuthErrorQuotaExceeded

Indicates that the project's quota for this operation (SMS messages, sign-ins, account creation) has been exceeded.

Try again later.

kAuthErrorRejectedCredential

Indicates that credential related request data is invalid.

This can occur when there is a project number mismatch (sessionInfo, spatula header, temporary proof), an incorrect temporary proof phone number, or during game center sign in when the user is already signed into a different game center account.

kAuthErrorRequiresRecentLogin

Indicates the user has attemped to change email or password more than 5 minutes after signing in, and will need to refresh the credentials.

Caused by "Set account info" methods.

kAuthErrorRetryPhoneAuth

Thrown when one or more of the credentials passed to a method fail to identify and/or authenticate the user subject of that operation.

Inspect the error message to find out the specific cause.

kAuthErrorSecondFactorAlreadyEnrolled

Indicates that the user is trying to enroll a second factor that already exists on their account.

kAuthErrorSessionExpired

Indicates that the SMS code has expired.

kAuthErrorTenantIdMismatch

Indicates that the provided tenant ID does not match the Auth instance's tenant ID.

kAuthErrorTooManyRequests

Indicates that too many requests were made to a server method.

Common error code for all API methods.

kAuthErrorUnauthorizedDomain

Indicates that the domain specified in the continue URL is not white- listed in the Firebase console.

kAuthErrorUnimplemented

Function will be implemented in a later revision of the API.

kAuthErrorUnsupportedFirstFactor

Indicates that a user either attempted to enroll in 2FA with an unsupported first factor or is enrolled and attempts a first factor sign in that is not supported for 2FA users.

kAuthErrorUnsupportedTenantOperation

Indicates that a request was made to the backend with an associated tenant ID for an operation that does not support multi-tenancy.

kAuthErrorUnverifiedEmail

Indicates that the user's email must be verified to perform that request.

kAuthErrorUserDisabled

Indicates the user’s account is disabled on the server.

Caused by "Sign in with credential" methods.

kAuthErrorUserMismatch

Indicates that an attempt was made to reauthenticate with a user which is not the current user.

kAuthErrorUserNotFound

Indicates the user account was not found.

Send password request email error code. Common error code for all API methods.

kAuthErrorUserTokenExpired

Indicates the saved token has expired.

For example, the user may have changed account password on another device. The user needs to sign in again on the device that made this request. Caused by requests with an STS id token.

kAuthErrorWeakPassword

Indicates an attempt to set a password that is considered too weak.

kAuthErrorWebContextAlreadyPresented

Indicates that an attempt was made to present a new web context while one was already being presented.

kAuthErrorWebContextCancelled

Indicates that the URL presentation was cancelled prematurely by the user.

kAuthErrorWebInternalError

Indicates that an internal error occurred during a web operation.

kAuthErrorWebStorateUnsupported

Indicates that 3rd party cookies or data are disabled, or that there was a problem with the browser.

kAuthErrorWrongPassword

Indicates the user attempted sign in with a wrong password.

Caused by "Sign in with password" methods.

Typedefs

UIParent

void * UIParent

A void pointer for stub classes.