public final class
FirebaseAuth
extends AbstractFirebaseAuth
This class is the entry point for all server-side Firebase Authentication actions.
You can get an instance of FirebaseAuth via getInstance(FirebaseApp)
and
then use it to perform a variety of authentication-related operations, including generating
custom tokens for use by client-side code, verifying Firebase ID Tokens received from clients, or
creating new FirebaseApp instances that are scoped to a particular authentication UID.
Public Method Summary
static FirebaseAuth |
getInstance()
Gets the FirebaseAuth instance for the default
FirebaseApp . |
synchronized static FirebaseAuth | |
TenantManager |
Inherited Method Summary
From class
com.google.firebase.auth.AbstractFirebaseAuth
String |
createCustomToken(String uid)
Creates a Firebase custom token for the given UID.
|
String |
createCustomToken(String uid, Map<String, Object> developerClaims)
Creates a Firebase custom token for the given UID, containing the specified additional claims.
|
ApiFuture<String> |
createCustomTokenAsync(String uid, Map<String, Object> developerClaims)
Similar to
createCustomToken(String, Map) but performs the operation asynchronously. |
ApiFuture<String> |
createCustomTokenAsync(String uid)
Similar to
createCustomToken(String) but performs the operation asynchronously. |
OidcProviderConfig |
createOidcProviderConfig(OidcProviderConfig.CreateRequest request)
Creates a new OpenID Connect auth provider config with the attributes contained in the
specified
OidcProviderConfig.CreateRequest . |
ApiFuture<OidcProviderConfig> |
createOidcProviderConfigAsync(OidcProviderConfig.CreateRequest request)
Similar to
createOidcProviderConfig(OidcProviderConfig.CreateRequest) but performs the operation asynchronously. |
SamlProviderConfig |
createSamlProviderConfig(SamlProviderConfig.CreateRequest request)
Creates a new SAML Auth provider config with the attributes contained in the specified
SamlProviderConfig.CreateRequest . |
ApiFuture<SamlProviderConfig> |
createSamlProviderConfigAsync(SamlProviderConfig.CreateRequest request)
Similar to
createSamlProviderConfig(SamlProviderConfig.CreateRequest) but performs the operation asynchronously. |
String |
createSessionCookie(String idToken, SessionCookieOptions options)
Creates a new Firebase session cookie from the given ID token and options.
|
ApiFuture<String> |
createSessionCookieAsync(String idToken, SessionCookieOptions options)
Similar to
createSessionCookie(String, SessionCookieOptions) but performs the
operation asynchronously. |
UserRecord |
createUser(UserRecord.CreateRequest request)
Creates a new user account with the attributes contained in the specified
UserRecord.CreateRequest . |
ApiFuture<UserRecord> |
createUserAsync(UserRecord.CreateRequest request)
Similar to
createUser(UserRecord.CreateRequest) but performs the operation asynchronously. |
void |
deleteOidcProviderConfig(String providerId)
Deletes the OpenID Connect auth provider config identified by the specified provider ID.
|
ApiFuture<Void> |
deleteOidcProviderConfigAsync(String providerId)
Similar to
deleteOidcProviderConfig(String) but performs the operation asynchronously. |
void |
deleteSamlProviderConfig(String providerId)
Deletes the SAML Auth provider config identified by the specified provider ID.
|
ApiFuture<Void> |
deleteSamlProviderConfigAsync(String providerId)
Similar to
deleteSamlProviderConfig(String) but performs the operation asynchronously. |
void |
deleteUser(String uid)
Deletes the user identified by the specified user ID.
|
ApiFuture<Void> |
deleteUserAsync(String uid)
Similar to
deleteUser(String) but performs the operation asynchronously. |
DeleteUsersResult |
deleteUsers(List<String> uids)
Deletes the users specified by the given identifiers.
|
ApiFuture<DeleteUsersResult> |
deleteUsersAsync(List<String> uids)
Similar to
deleteUsers(List) but performs the operation asynchronously. |
String |
generateEmailVerificationLink(String email, ActionCodeSettings settings)
Generates the out-of-band email action link for email verification flows for the specified
email address, using the action code settings provided.
|
String |
generateEmailVerificationLink(String email)
Generates the out-of-band email action link for email verification flows for the specified
email address.
|
ApiFuture<String> |
generateEmailVerificationLinkAsync(String email, ActionCodeSettings settings)
Similar to
generateEmailVerificationLink(String, ActionCodeSettings) but performs the
operation asynchronously. |
ApiFuture<String> |
generateEmailVerificationLinkAsync(String email)
Similar to
generateEmailVerificationLink(String) but performs the operation
asynchronously. |
String |
generatePasswordResetLink(String email, ActionCodeSettings settings)
Generates the out-of-band email action link for password reset flows for the specified email
address.
|
String |
generatePasswordResetLink(String email)
Generates the out-of-band email action link for password reset flows for the specified email
address.
|
ApiFuture<String> |
generatePasswordResetLinkAsync(String email, ActionCodeSettings settings)
Similar to
generatePasswordResetLink(String, ActionCodeSettings) but performs the
operation asynchronously. |
ApiFuture<String> |
generatePasswordResetLinkAsync(String email)
Similar to
generatePasswordResetLink(String) but performs the operation
asynchronously. |
String |
generateSignInWithEmailLink(String email, ActionCodeSettings settings)
Generates the out-of-band email action link for email link sign-in flows, using the action code
settings provided.
|
ApiFuture<String> |
generateSignInWithEmailLinkAsync(String email, ActionCodeSettings settings)
Similar to
generateSignInWithEmailLink(String, ActionCodeSettings) but performs the
operation asynchronously. |
OidcProviderConfig |
getOidcProviderConfig(String providerId)
Gets the OpenID Connect auth provider corresponding to the specified provider ID.
|
ApiFuture<OidcProviderConfig> |
getOidcProviderConfigAsync(String providerId)
Similar to
getOidcProviderConfig(String) but performs the operation asynchronously. |
SamlProviderConfig |
getSamlProviderConfig(String providerId)
Gets the SAML Auth provider config corresponding to the specified provider ID.
|
ApiFuture<SamlProviderConfig> |
getSamlProviderConfigAsync(String providerId)
Similar to
getSamlProviderConfig(String) but performs the operation asynchronously. |
UserRecord |
getUser(String uid)
Gets the user data corresponding to the specified user ID.
|
ApiFuture<UserRecord> |
getUserAsync(String uid)
Similar to
getUser(String) but performs the operation asynchronously. |
UserRecord |
getUserByEmail(String email)
Gets the user data corresponding to the specified user email.
|
ApiFuture<UserRecord> |
getUserByEmailAsync(String email)
Similar to
getUserByEmail(String) but performs the operation asynchronously. |
UserRecord |
getUserByPhoneNumber(String phoneNumber)
Gets the user data corresponding to the specified user phone number.
|
ApiFuture<UserRecord> |
getUserByPhoneNumberAsync(String phoneNumber)
Gets the user data corresponding to the specified user phone number.
|
UserRecord |
getUserByProviderUid(String providerId, String uid)
Gets the user data for the user corresponding to a given provider ID.
|
ApiFuture<UserRecord> |
getUserByProviderUidAsync(String providerId, String uid)
Gets the user data for the user corresponding to a given provider ID.
|
GetUsersResult |
getUsers(Collection<UserIdentifier> identifiers)
Gets the user data corresponding to the specified identifiers.
|
ApiFuture<GetUsersResult> |
getUsersAsync(Collection<UserIdentifier> identifiers)
Gets the user data corresponding to the specified identifiers.
|
UserImportResult | |
UserImportResult |
importUsers(List<ImportUserRecord> users, UserImportOptions options)
Imports the provided list of users into Firebase Auth.
|
ApiFuture<UserImportResult> |
importUsersAsync(List<ImportUserRecord> users)
Similar to
importUsers(List) but performs the operation asynchronously. |
ApiFuture<UserImportResult> |
importUsersAsync(List<ImportUserRecord> users, UserImportOptions options)
Similar to
importUsers(List, UserImportOptions) but performs the operation
asynchronously. |
ListProviderConfigsPage<OidcProviderConfig> |
listOidcProviderConfigs(String pageToken)
Gets a page of OpenID Connect auth provider configs starting from the specified
pageToken . |
ListProviderConfigsPage<OidcProviderConfig> |
listOidcProviderConfigs(String pageToken, int maxResults)
Gets a page of OpenID Connect auth provider configs starting from the specified
pageToken . |
ApiFuture<ListProviderConfigsPage<OidcProviderConfig>> |
listOidcProviderConfigsAsync(String pageToken)
Similar to
listOidcProviderConfigs(String) but performs the operation asynchronously. |
ApiFuture<ListProviderConfigsPage<OidcProviderConfig>> |
listOidcProviderConfigsAsync(String pageToken, int maxResults)
Similar to
listOidcProviderConfigs(String, int) but performs the operation
asynchronously. |
ListProviderConfigsPage<SamlProviderConfig> |
listSamlProviderConfigs(String pageToken)
Gets a page of SAML Auth provider configs starting from the specified
pageToken . |
ListProviderConfigsPage<SamlProviderConfig> |
listSamlProviderConfigs(String pageToken, int maxResults)
Gets a page of SAML Auth provider configs starting from the specified
pageToken . |
ApiFuture<ListProviderConfigsPage<SamlProviderConfig>> |
listSamlProviderConfigsAsync(String pageToken)
Similar to
listSamlProviderConfigs(String) but performs the operation asynchronously. |
ApiFuture<ListProviderConfigsPage<SamlProviderConfig>> |
listSamlProviderConfigsAsync(String pageToken, int maxResults)
Similar to
listSamlProviderConfigs(String, int) but performs the operation
asynchronously. |
ListUsersPage |
listUsers(String pageToken, int maxResults)
Gets a page of users starting from the specified
pageToken . |
ListUsersPage |
listUsers(String pageToken)
Gets a page of users starting from the specified
pageToken . |
ApiFuture<ListUsersPage> |
listUsersAsync(String pageToken, int maxResults)
Similar to
listUsers(String, int) but performs the operation asynchronously. |
ApiFuture<ListUsersPage> |
listUsersAsync(String pageToken)
Similar to
listUsers(String) but performs the operation asynchronously. |
static <T extends Builder<T>> T | |
void |
revokeRefreshTokens(String uid)
Revokes all refresh tokens for the specified user.
|
ApiFuture<Void> |
revokeRefreshTokensAsync(String uid)
Similar to
revokeRefreshTokens(String) but performs the operation asynchronously. |
void |
setCustomClaims(String uid, Map<String, Object> claims)
This method is deprecated.
Use
setCustomUserClaims(String, Map) instead.
|
void |
setCustomUserClaims(String uid, Map<String, Object> claims)
Sets the specified custom claims on an existing user account.
|
ApiFuture<Void> |
setCustomUserClaimsAsync(String uid, Map<String, Object> claims)
Similar to
setCustomUserClaims(String, Map) but performs the operation asynchronously. |
OidcProviderConfig |
updateOidcProviderConfig(OidcProviderConfig.UpdateRequest request)
Updates an existing OpenID Connect auth provider config with the attributes contained in the
specified
OidcProviderConfig.UpdateRequest . |
ApiFuture<OidcProviderConfig> |
updateOidcProviderConfigAsync(OidcProviderConfig.UpdateRequest request)
Similar to
updateOidcProviderConfig(OidcProviderConfig.UpdateRequest) but performs the operation asynchronously. |
SamlProviderConfig |
updateSamlProviderConfig(SamlProviderConfig.UpdateRequest request)
Updates an existing SAML Auth provider config with the attributes contained in the specified
SamlProviderConfig.UpdateRequest . |
ApiFuture<SamlProviderConfig> |
updateSamlProviderConfigAsync(SamlProviderConfig.UpdateRequest request)
Similar to
updateSamlProviderConfig(SamlProviderConfig.UpdateRequest) but performs the operation asynchronously. |
UserRecord |
updateUser(UserRecord.UpdateRequest request)
Updates an existing user account with the attributes contained in the specified
UserRecord.UpdateRequest . |
ApiFuture<UserRecord> |
updateUserAsync(UserRecord.UpdateRequest request)
Similar to
updateUser(UserRecord.UpdateRequest) but performs the operation asynchronously. |
FirebaseToken |
verifyIdToken(String idToken, boolean checkRevoked)
Parses and verifies a Firebase ID Token.
|
FirebaseToken |
verifyIdToken(String idToken)
Parses and verifies a Firebase ID Token.
|
ApiFuture<FirebaseToken> |
verifyIdTokenAsync(String idToken)
Similar to
verifyIdToken(String) but performs the operation asynchronously. |
ApiFuture<FirebaseToken> |
verifyIdTokenAsync(String idToken, boolean checkRevoked)
Similar to
verifyIdToken(String, boolean) but performs the operation asynchronously. |
FirebaseToken |
verifySessionCookie(String cookie, boolean checkRevoked)
Parses and verifies a Firebase session cookie.
|
FirebaseToken |
verifySessionCookie(String cookie)
Parses and verifies a Firebase session cookie.
|
ApiFuture<FirebaseToken> |
verifySessionCookieAsync(String cookie, boolean checkRevoked)
Similar to
verifySessionCookie(String, boolean) but performs the operation
asynchronously. |
ApiFuture<FirebaseToken> |
verifySessionCookieAsync(String cookie)
Similar to
verifySessionCookie(String) but performs the operation asynchronously. |
From class
java.lang.Object
Object |
clone()
|
boolean |
equals(Object arg0)
|
void |
finalize()
|
final Class<?> |
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String |
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Methods
public static FirebaseAuth getInstance ()
Gets the FirebaseAuth instance for the default FirebaseApp
.
Returns
- The FirebaseAuth instance for the default
FirebaseApp
.
public static synchronized FirebaseAuth getInstance (FirebaseApp app)
Gets an instance of FirebaseAuth for a specific FirebaseApp
.
Parameters
app | The FirebaseApp to get a FirebaseAuth instance for. |
---|
Returns
- A FirebaseAuth instance.