Package com.firebase.ui.auth.data.remote
Class GenericIdpSignInHandler
- java.lang.Object
-
- androidx.lifecycle.ViewModel
-
- androidx.lifecycle.AndroidViewModel
-
- com.firebase.ui.auth.viewmodel.ViewModelBase<I>
-
- com.firebase.ui.auth.viewmodel.OperableViewModel<T,Resource<IdpResponse>>
-
- com.firebase.ui.auth.viewmodel.ProviderSignInBase<AuthUI.IdpConfig>
-
- com.firebase.ui.auth.data.remote.GenericIdpSignInHandler
-
- Direct Known Subclasses:
GenericIdpAnonymousUpgradeLinkingHandler
public class GenericIdpSignInHandler extends ProviderSignInBase<AuthUI.IdpConfig>
-
-
Constructor Summary
Constructors Constructor Description GenericIdpSignInHandler(Application application)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.firebase.auth.OAuthProviderbuildOAuthProvider(String providerId, com.google.firebase.auth.FirebaseAuth auth)static AuthUI.IdpConfiggetGenericFacebookConfig()static AuthUI.IdpConfiggetGenericGoogleConfig()protected voidhandleMergeFailure(com.google.firebase.auth.AuthCredential credential)protected voidhandleNormalSignInFlow(com.google.firebase.auth.FirebaseAuth auth, HelperActivityBase activity, com.google.firebase.auth.OAuthProvider provider)protected voidhandleSuccess(boolean isUseEmulator, String providerId, com.google.firebase.auth.FirebaseUser user, com.google.firebase.auth.OAuthCredential credential, boolean isNewUser)protected voidhandleSuccess(boolean isUseEmulator, String providerId, com.google.firebase.auth.FirebaseUser user, com.google.firebase.auth.OAuthCredential credential, boolean isNewUser, boolean setPendingCredential)voidinitializeForTesting(AuthUI.IdpConfig idpConfig)voidonActivityResult(int requestCode, int resultCode, Intent data)voidstartSignIn(HelperActivityBase activity)Start the login process for the IDP, e.g.voidstartSignIn(com.google.firebase.auth.FirebaseAuth auth, HelperActivityBase activity, String providerId)Start the login process for the IDP using the web based Generic IDP flow if applicable, e.g.-
Methods inherited from class com.firebase.ui.auth.viewmodel.ProviderSignInBase
initWith
-
Methods inherited from class com.firebase.ui.auth.viewmodel.OperableViewModel
getOperation, setResult
-
Methods inherited from class com.firebase.ui.auth.viewmodel.ViewModelBase
getArguments, init, onCleared, onCreate, setArguments
-
-
-
-
Constructor Detail
-
GenericIdpSignInHandler
public GenericIdpSignInHandler(Application application)
-
-
Method Detail
-
getGenericGoogleConfig
@NonNull public static AuthUI.IdpConfig getGenericGoogleConfig()
-
getGenericFacebookConfig
@NonNull public static AuthUI.IdpConfig getGenericFacebookConfig()
-
startSignIn
public final void startSignIn(@NonNull HelperActivityBase activity)Description copied from class:ProviderSignInBaseStart the login process for the IDP, e.g. show the Google sign-in activity.- Specified by:
startSignInin classProviderSignInBase<AuthUI.IdpConfig>- Parameters:
activity- from which to start the login, DO NOT USE OUTSIDE OF THIS METHOD!!!
-
startSignIn
public void startSignIn(@NonNull com.google.firebase.auth.FirebaseAuth auth, @NonNull HelperActivityBase activity, @NonNull String providerId)Description copied from class:ProviderSignInBaseStart the login process for the IDP using the web based Generic IDP flow if applicable, e.g. sign-in through a custom-chrome tab, otherwise falls back to the default method.- Specified by:
startSignInin classProviderSignInBase<AuthUI.IdpConfig>- Parameters:
auth- the Firebase auth instanceactivity- from which to start the login, DO NOT USE OUTSIDE OF THIS METHOD!!!providerId- the provider to sign-in with (e.g. "microsoft.com")
-
handleNormalSignInFlow
protected void handleNormalSignInFlow(com.google.firebase.auth.FirebaseAuth auth, HelperActivityBase activity, com.google.firebase.auth.OAuthProvider provider)
-
buildOAuthProvider
public com.google.firebase.auth.OAuthProvider buildOAuthProvider(String providerId, com.google.firebase.auth.FirebaseAuth auth)
-
handleSuccess
protected void handleSuccess(boolean isUseEmulator, @NonNull String providerId, @NonNull com.google.firebase.auth.FirebaseUser user, @NonNull com.google.firebase.auth.OAuthCredential credential, boolean isNewUser, boolean setPendingCredential)
-
handleSuccess
protected void handleSuccess(boolean isUseEmulator, @NonNull String providerId, @NonNull com.google.firebase.auth.FirebaseUser user, @NonNull com.google.firebase.auth.OAuthCredential credential, boolean isNewUser)
-
handleMergeFailure
protected void handleMergeFailure(@NonNull com.google.firebase.auth.AuthCredential credential)
-
onActivityResult
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data)- Specified by:
onActivityResultin classProviderSignInBase<AuthUI.IdpConfig>
-
initializeForTesting
public void initializeForTesting(AuthUI.IdpConfig idpConfig)
-
-