public final class AuthUI extends Object
FirebaseApp instance, an AuthUI instance can be retrieved
simply by calling getInstance(). If an alternative app instance is in use, call
getInstance(FirebaseApp) instead, passing the appropriate app instance.
See the README for examples on how to get started with FirebaseUI Auth.
| Modifier and Type | Class and Description |
|---|---|
static class |
AuthUI.IdpConfig
Configuration for an identity provider.
|
class |
AuthUI.SignInIntentBuilder
Builder for the intent to start the user authentication flow.
|
static interface |
AuthUI.SupportedProvider |
| Modifier and Type | Field and Description |
|---|---|
static String |
ANONYMOUS_PROVIDER
Provider for anonymous users.
|
static String |
APPLE_PROVIDER |
static String |
EMAIL_LINK_PROVIDER |
static String |
MICROSOFT_PROVIDER |
static int |
NO_LOGO
Default value for logo resource, omits the logo from the
AuthMethodPickerActivity. |
static Set<String> |
SOCIAL_PROVIDERS
The set of social authentication providers supported in Firebase Auth UI using their SDK.
|
static Set<String> |
SUPPORTED_OAUTH_PROVIDERS
The set of OAuth2.0 providers supported in Firebase Auth UI through Generic IDP (web flow).
|
static Set<String> |
SUPPORTED_PROVIDERS
The set of authentication providers supported in Firebase Auth UI.
|
static String |
TAG |
static String |
UNCONFIGURED_CONFIG_VALUE |
static String |
YAHOO_PROVIDER |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canHandleIntent(Intent intent)
Returns true if AuthUI can handle the intent.
|
AuthUI.SignInIntentBuilder |
createSignInIntentBuilder()
Starts the process of creating a sign in intent, with the mandatory application context
parameter.
|
com.google.android.gms.tasks.Task<Void> |
delete(Context context)
Delete the use from FirebaseAuth and delete any associated credentials from the Credentials
API.
|
com.google.firebase.FirebaseApp |
getApp() |
static Context |
getApplicationContext() |
com.google.firebase.auth.FirebaseAuth |
getAuth() |
static int |
getDefaultTheme()
Default theme used by
AuthUI.AuthIntentBuilder.setTheme(int) if no theme customization is
required. |
String |
getEmulatorHost() |
int |
getEmulatorPort() |
static AuthUI |
getInstance()
Retrieves the
AuthUI instance associated with the default app, as returned by FirebaseApp.getInstance(). |
static AuthUI |
getInstance(com.google.firebase.FirebaseApp app)
Retrieves the
AuthUI instance associated the the specified app. |
static AuthUI |
getInstance(String appName)
Retrieves the
AuthUI instance associated the the specified app name. |
boolean |
isUseEmulator() |
static void |
setApplicationContext(Context context) |
com.google.android.gms.tasks.Task<Void> |
signOut(Context context)
Signs the current user out, if one is signed in.
|
com.google.android.gms.tasks.Task<com.google.firebase.auth.AuthResult> |
silentSignIn(Context context,
List<AuthUI.IdpConfig> configs)
Signs the user in without any UI if possible.
|
void |
useEmulator(String host,
int port)
Connect to the Firebase Authentication emulator.
|
public static final String TAG
public static final String ANONYMOUS_PROVIDER
public static final String EMAIL_LINK_PROVIDER
public static final String MICROSOFT_PROVIDER
public static final String YAHOO_PROVIDER
public static final String APPLE_PROVIDER
public static final int NO_LOGO
AuthMethodPickerActivity.public static final Set<String> SUPPORTED_PROVIDERS
public static final Set<String> SUPPORTED_OAUTH_PROVIDERS
public static final Set<String> SOCIAL_PROVIDERS
public static final String UNCONFIGURED_CONFIG_VALUE
@NonNull public static Context getApplicationContext()
public static void setApplicationContext(@NonNull
Context context)
@NonNull public static AuthUI getInstance()
AuthUI instance associated with the default app, as returned by FirebaseApp.getInstance().IllegalStateException - if the default app is not initialized.@NonNull public static AuthUI getInstance(@NonNull String appName)
AuthUI instance associated the the specified app name.IllegalStateException - if the app is not initialized.@NonNull public static AuthUI getInstance(@NonNull com.google.firebase.FirebaseApp app)
AuthUI instance associated the the specified app.@NonNull public com.google.firebase.FirebaseApp getApp()
@NonNull public com.google.firebase.auth.FirebaseAuth getAuth()
public static boolean canHandleIntent(@NonNull
Intent 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.
@StyleRes public static int getDefaultTheme()
AuthUI.AuthIntentBuilder.setTheme(int) if no theme customization is
required.@NonNull
public com.google.android.gms.tasks.Task<com.google.firebase.auth.AuthResult> silentSignIn(@NonNull
Context context,
@NonNull
List<AuthUI.IdpConfig> configs)
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.@NonNull public com.google.android.gms.tasks.Task<Void> signOut(@NonNull Context context)
context - the context requesting the user be signed outTask.isSuccessful(), or that the sign-out attempt failed unexpectedly !Task.isSuccessful()).@NonNull public com.google.android.gms.tasks.Task<Void> delete(@NonNull Context context)
Task that succeeds if the Firebase Auth user deletion succeeds and
fails if the Firebase Auth deletion fails. Credentials deletion failures are handled
silently.context - the calling Context.public void useEmulator(@NonNull
String host,
int port)
FirebaseAuth.useEmulator(String, int)public boolean isUseEmulator()
public String getEmulatorHost()
public int getEmulatorPort()
@NonNull public AuthUI.SignInIntentBuilder createSignInIntentBuilder()