Package com.firebase.ui.auth
Class AuthUI
- java.lang.Object
-
- com.firebase.ui.auth.AuthUI
-
public final class AuthUI extends java.lang.ObjectThe entry point to the AuthUI authentication flow, and related utility methods. If your application uses the defaultFirebaseAppinstance, an AuthUI instance can be retrieved simply by callinggetInstance(). If an alternative app instance is in use, callgetInstance(FirebaseApp)instead, passing the appropriate app instance.See the README for examples on how to get started with FirebaseUI Auth.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAuthUI.IdpConfigConfiguration for an identity provider.classAuthUI.SignInIntentBuilderBuilder for the intent to start the user authentication flow.static interfaceAuthUI.SupportedProvider
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringANONYMOUS_PROVIDERProvider for anonymous users.static java.lang.StringAPPLE_PROVIDERstatic java.lang.StringEMAIL_LINK_PROVIDERstatic java.lang.StringMICROSOFT_PROVIDERstatic intNO_LOGODefault value for logo resource, omits the logo from theAuthMethodPickerActivity.static java.util.Set<java.lang.String>SOCIAL_PROVIDERSThe set of social authentication providers supported in Firebase Auth UI using their SDK.static java.util.Set<java.lang.String>SUPPORTED_OAUTH_PROVIDERSThe set of OAuth2.0 providers supported in Firebase Auth UI through Generic IDP (web flow).static java.util.Set<java.lang.String>SUPPORTED_PROVIDERSThe set of authentication providers supported in Firebase Auth UI.static java.lang.StringTAGstatic java.lang.StringUNCONFIGURED_CONFIG_VALUEstatic java.lang.StringYAHOO_PROVIDER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleancanHandleIntent(android.content.Intent intent)Returns true if AuthUI can handle the intent.AuthUI.SignInIntentBuildercreateSignInIntentBuilder()Starts the process of creating a sign in intent, with the mandatory application context parameter.com.google.android.gms.tasks.Task<java.lang.Void>delete(android.content.Context context)Delete the use from FirebaseAuth and delete any associated credentials from the Credentials API.static android.content.ContextgetApplicationContext()static intgetDefaultTheme()Default theme used byAuthUI.AuthIntentBuilder.setTheme(int)if no theme customization is required.static AuthUIgetInstance()Retrieves theAuthUIinstance associated with the default app, as returned byFirebaseApp.getInstance().static AuthUIgetInstance(com.google.firebase.FirebaseApp app)Retrieves theAuthUIinstance associated the the specified app.static voidsetApplicationContext(android.content.Context context)com.google.android.gms.tasks.Task<java.lang.Void>signOut(android.content.Context context)Signs the current user out, if one is signed in.com.google.android.gms.tasks.Task<com.google.firebase.auth.AuthResult>silentSignIn(android.content.Context context, java.util.List<AuthUI.IdpConfig> configs)Signs the user in without any UI if possible.
-
-
-
Field Detail
-
TAG
public static final java.lang.String TAG
- See Also:
- Constant Field Values
-
ANONYMOUS_PROVIDER
public static final java.lang.String ANONYMOUS_PROVIDER
Provider for anonymous users.- See Also:
- Constant Field Values
-
EMAIL_LINK_PROVIDER
public static final java.lang.String EMAIL_LINK_PROVIDER
- See Also:
- Constant Field Values
-
MICROSOFT_PROVIDER
public static final java.lang.String MICROSOFT_PROVIDER
- See Also:
- Constant Field Values
-
YAHOO_PROVIDER
public static final java.lang.String YAHOO_PROVIDER
- See Also:
- Constant Field Values
-
APPLE_PROVIDER
public static final java.lang.String APPLE_PROVIDER
- See Also:
- Constant Field Values
-
NO_LOGO
public static final int NO_LOGO
Default value for logo resource, omits the logo from theAuthMethodPickerActivity.- See Also:
- Constant Field Values
-
SUPPORTED_PROVIDERS
public static final java.util.Set<java.lang.String> SUPPORTED_PROVIDERS
The set of authentication providers supported in Firebase Auth UI.
-
SUPPORTED_OAUTH_PROVIDERS
public static final java.util.Set<java.lang.String> SUPPORTED_OAUTH_PROVIDERS
The set of OAuth2.0 providers supported in Firebase Auth UI through Generic IDP (web flow).
-
SOCIAL_PROVIDERS
public static final java.util.Set<java.lang.String> SOCIAL_PROVIDERS
The set of social authentication providers supported in Firebase Auth UI using their SDK.
-
UNCONFIGURED_CONFIG_VALUE
public static final java.lang.String UNCONFIGURED_CONFIG_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getApplicationContext
@NonNull public static android.content.Context getApplicationContext()
-
setApplicationContext
public static void setApplicationContext(@NonNull android.content.Context context)
-
getInstance
@NonNull public static AuthUI getInstance()
Retrieves theAuthUIinstance associated with the default app, as returned byFirebaseApp.getInstance().- Throws:
java.lang.IllegalStateException- if the default app is not initialized.
-
getInstance
@NonNull public static AuthUI getInstance(@NonNull com.google.firebase.FirebaseApp app)
Retrieves theAuthUIinstance associated the the specified app.
-
canHandleIntent
public static boolean canHandleIntent(@NonNull android.content.Intent intent)Returns true if AuthUI can handle the intent.AuthUI handle the intent when the embedded data is an email link. If it is, you can then specify the link in
AuthUI.SignInIntentBuilder.setEmailLink(String)before starting AuthUI and it will be handled immediately.
-
getDefaultTheme
@StyleRes public static int getDefaultTheme()
Default theme used byAuthUI.AuthIntentBuilder.setTheme(int)if no theme customization is required.
-
silentSignIn
@NonNull public com.google.android.gms.tasks.Task<com.google.firebase.auth.AuthResult> silentSignIn(@NonNull android.content.Context context, @NonNull java.util.List<AuthUI.IdpConfig> configs)Signs the user in without any UI if possible. If this operation fails, you can safely start a UI-based sign-in flow knowing it is required.- Parameters:
context- requesting the user be signed inconfigs- to use for silent sign in. Only Google and email are currently supported, the rest will be ignored.- Returns:
- a task which indicates whether or not the user was successfully signed in.
-
signOut
@NonNull public com.google.android.gms.tasks.Task<java.lang.Void> signOut(@NonNull android.content.Context context)Signs the current user out, if one is signed in.- Parameters:
context- the context requesting the user be signed out- Returns:
- A task which, upon completion, signals that the user has been signed out (
Task.isSuccessful(), or that the sign-out attempt failed unexpectedly !Task.isSuccessful()).
-
delete
@NonNull public com.google.android.gms.tasks.Task<java.lang.Void> delete(@NonNull android.content.Context context)Delete the use from FirebaseAuth and delete any associated credentials from the Credentials API. Returns aTaskthat succeeds if the Firebase Auth user deletion succeeds and fails if the Firebase Auth deletion fails. Credentials deletion failures are handled silently.- Parameters:
context- the callingContext.
-
createSignInIntentBuilder
@NonNull public AuthUI.SignInIntentBuilder createSignInIntentBuilder()
Starts the process of creating a sign in intent, with the mandatory application context parameter.
-
-