Summary: Nested Classes | Constants | Inherited Constants | Fields | Methods | Inherited Methods | [Expand All]
public class

# Credential

extends Object
implements SafeParcelable Parcelable

java.lang.Object
↳ | com.google.android.gms.auth.api.credentials.Credential

## Class Overview

A credential that can be used to authenticate a user, with additional user information used to distinguish this credential from other available credentials. Credentials can be constructed using `Credential.Builder`. This is typically required when a credential is to be saved using `Auth.CredentialsApi.save()` for future retrieval after a new account is created, or the user changes their password.

## Summary

Nested Classes
class | Credential.Builder |

Constants
String | EXTRA_KEY | The key for `Credential` values stored in a bundle or intent extra, typically in response to a resolution intent from `request(GoogleApiClient, CredentialRequest)`.

[Expand] Inherited Constants
From interface com.google.android.gms.common.internal.safeparcel.SafeParcelable
String | NULL |
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

Fields
public static final Creator<Credential> | CREATOR |

Public Methods
boolean | equals(Object other)
String | getAccountType() Returns the type of federated identity account used to sign in the user.
String | getGeneratedPassword() Returns the generated password for an account hint.
String | getId() Returns the credential identifier, typically an email address or user name, though it may also be some encoded unique identifier for a federated identity account.
List<IdToken> | getIdTokens() Returns the ID tokens that assert the identity of the user, if available.
String | getName() Returns the display name of the credential, if available.
String | getPassword() Returns the password used to sign in the user.
Uri | getProfilePictureUri() Returns the URL to an image of the user, if available.
int | hashCode()
void | writeToParcel(Parcel out, int flags)

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

## Constants

#### public static final String EXTRA_KEY

The key for `Credential` values stored in a bundle or intent extra, typically in response to a resolution intent from `request(GoogleApiClient, CredentialRequest)`.

Constant Value: "com.google.android.gms.credentials.Credential"

## Fields

#### public static final Creator<Credential> CREATOR

## Public Methods

#### public boolean equals (Object other)

#### public String getAccountType ()

Returns the type of federated identity account used to sign in the user. While this may be any string, it is strongly recommended that values from `IdentityProviders` are used, which are the login domains for common identity providers.

##### Returns

- A string identifying the federated identity provider associated with this account, typically in the form of the identity provider's login domain. `null` will be returned if the credential is a password credential.

#### public String getGeneratedPassword ()

Returns the generated password for an account hint.

#### public String getId ()

Returns the credential identifier, typically an email address or user name, though it may also be some encoded unique identifier for a federated identity account.

#### public List<IdToken> getIdTokens ()

Returns the ID tokens that assert the identity of the user, if available. ID tokens provide a secure mechanism to verify that the user owns the identity asserted by the credential.

This is useful for account hints, where the ID token can replace the need to separately verify that the user owns their claimed email address - with a valid ID token, it is not necessary to send an account activation link to the address, simplifying the account creation process for the user.

A signed ID token is returned automatically for credential hints when the credential ID is a Google account that is authenticated on the device. This ID token can be sent along with your application's account creation operation, where the signature can be verified.

#### public String getName ()

Returns the display name of the credential, if available. Typically, the display name will be the name of the user, or some other string which the user can easily recognize and distinguish from other accounts they may have.

#### public String getPassword ()

Returns the password used to sign in the user.

#### public Uri getProfilePictureUri ()

Returns the URL to an image of the user, if available.

#### public int hashCode ()

#### public void writeToParcel (Parcel out, int flags)