Package com.firebase.ui.auth
Class IdpResponse
- java.lang.Object
-
- com.firebase.ui.auth.IdpResponse
-
- All Implemented Interfaces:
Parcelable
public class IdpResponse extends Object implements Parcelable
A container that encapsulates the result of authenticating with an Identity Provider.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIdpResponse.Builder-
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static Parcelable.Creator<IdpResponse>CREATOR-
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()booleanequals(Object o)static IdpResponsefrom(Exception e)static IdpResponsefromResultIntent(Intent resultIntent)Extract theIdpResponsefrom the flow's result intent.com.google.firebase.auth.AuthCredentialgetCredentialForLinking()StringgetEmail()Get the email used to sign in.FirebaseUiExceptiongetError()Get the error for a failed sign in.static IntentgetErrorIntent(Exception e)StringgetIdpSecret()Twitter only.StringgetIdpToken()Get the token received as a result of logging in with the specified IDPStringgetPhoneNumber()Get the phone number used to sign in.StringgetProviderType()Get the type of provider.UsergetUser()booleanhasCredentialForLinking()inthashCode()booleanisNewUser()Returns true if this user has just signed up, false otherwise.booleanisRecoverableErrorResponse()booleanisSuccessful()IdpResponse.Buildermutate()IntenttoIntent()StringtoString()IdpResponsewithResult(com.google.firebase.auth.AuthResult result)voidwriteToParcel(Parcel dest, int flags)
-
-
-
Field Detail
-
CREATOR
public static final Parcelable.Creator<IdpResponse> CREATOR
-
-
Method Detail
-
fromResultIntent
@Nullable public static IdpResponse fromResultIntent(@Nullable Intent resultIntent)
Extract theIdpResponsefrom the flow's result intent.- Parameters:
resultIntent- The intent whichonActivityResultwas called with.- Returns:
- The IdpResponse containing the token(s) from signing in with the Idp
-
from
@NonNull public static IdpResponse from(@NonNull Exception e)
-
withResult
@NonNull public IdpResponse withResult(com.google.firebase.auth.AuthResult result)
-
toIntent
@NonNull public Intent toIntent()
-
mutate
@NonNull public IdpResponse.Builder mutate()
-
isSuccessful
public boolean isSuccessful()
-
getUser
public User getUser()
-
getProviderType
@Nullable public String getProviderType()
Get the type of provider. e.g.GoogleAuthProvider.PROVIDER_ID
-
isNewUser
public boolean isNewUser()
Returns true if this user has just signed up, false otherwise.
-
getEmail
@Nullable public String getEmail()
Get the email used to sign in.
-
getPhoneNumber
@Nullable public String getPhoneNumber()
Get the phone number used to sign in.
-
getIdpToken
@Nullable public String getIdpToken()
Get the token received as a result of logging in with the specified IDP
-
getIdpSecret
@Nullable public String getIdpSecret()
Twitter only. Return the token secret received as a result of logging in with Twitter.
-
getError
@Nullable public FirebaseUiException getError()
Get the error for a failed sign in.
-
getCredentialForLinking
@Nullable public com.google.firebase.auth.AuthCredential getCredentialForLinking()
-
hasCredentialForLinking
@Nullable public boolean hasCredentialForLinking()
-
isRecoverableErrorResponse
public boolean isRecoverableErrorResponse()
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceParcelable
-
writeToParcel
public void writeToParcel(Parcel dest, int flags)
- Specified by:
writeToParcelin interfaceParcelable
-
-