Package com.firebase.ui.auth
Class IdpResponse
- java.lang.Object
-
- com.firebase.ui.auth.IdpResponse
-
- All Implemented Interfaces:
android.os.Parcelable
public class IdpResponse extends java.lang.Object implements android.os.ParcelableA container that encapsulates the result of authenticating with an Identity Provider.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIdpResponse.Builder
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<IdpResponse>CREATOR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intdescribeContents()booleanequals(java.lang.Object o)static IdpResponsefrom(java.lang.Exception e)static IdpResponsefromResultIntent(android.content.Intent resultIntent)Extract theIdpResponsefrom the flow's result intent.com.google.firebase.auth.AuthCredentialgetCredentialForLinking()java.lang.StringgetEmail()Get the email used to sign in.FirebaseUiExceptiongetError()Get the error for a failed sign in.static android.content.IntentgetErrorIntent(java.lang.Exception e)java.lang.StringgetIdpSecret()Twitter only.java.lang.StringgetIdpToken()Get the token received as a result of logging in with the specified IDPjava.lang.StringgetPhoneNumber()Get the phone number used to sign in.java.lang.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()android.content.IntenttoIntent()java.lang.StringtoString()IdpResponsewithResult(com.google.firebase.auth.AuthResult result)voidwriteToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
CREATOR
public static final android.os.Parcelable.Creator<IdpResponse> CREATOR
-
-
Method Detail
-
fromResultIntent
@Nullable public static IdpResponse fromResultIntent(@Nullable android.content.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 java.lang.Exception e)
-
getErrorIntent
@NonNull public static android.content.Intent getErrorIntent(@NonNull java.lang.Exception e)
-
withResult
@NonNull public IdpResponse withResult(com.google.firebase.auth.AuthResult result)
-
toIntent
@NonNull public android.content.Intent toIntent()
-
mutate
@NonNull public IdpResponse.Builder mutate()
-
isSuccessful
public boolean isSuccessful()
-
getUser
public User getUser()
-
getProviderType
@Nullable public java.lang.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 java.lang.String getEmail()
Get the email used to sign in.
-
getPhoneNumber
@Nullable public java.lang.String getPhoneNumber()
Get the phone number used to sign in.
-
getIdpToken
@Nullable public java.lang.String getIdpToken()
Get the token received as a result of logging in with the specified IDP
-
getIdpSecret
@Nullable public java.lang.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 interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)- Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-