EmailAuthProvider

public classEmailAuthProvider


Represents the email and password authentication mechanism. Use this class to obtain s.

Summary

Constants

static finalString

Unique string identifier for email/link sign-in method.

static finalString

Unique string identifier for email/password sign-in method.

static finalString
PROVIDER_ID = "password"

Unique string identifier for this provider type.

Public methods

static @NonNullAuthCredential

Returns a new instance ofAuthCredential that wraps a given email and password.

static @NonNullAuthCredential

Returns a new instance ofAuthCredential that wraps an email sign-in link.

Constants

EMAIL_LINK_SIGN_IN_METHOD

public static final String EMAIL_LINK_SIGN_IN_METHOD = "emailLink"

Unique string identifier for email/link sign-in method. Indicates the signin methodssignInWithEmailLink andsignInWithCredential with anEmailAuthCredential generated bygetCredentialWithLink.

EMAIL_PASSWORD_SIGN_IN_METHOD

public static final String EMAIL_PASSWORD_SIGN_IN_METHOD = "password"

Unique string identifier for email/password sign-in method. Indicates the signin methodssignInWithEmailAndPassword andsignInWithCredential with anEmailAuthCredential generated bygetCredential.

PROVIDER_ID

public static final String PROVIDER_ID = "password"

Unique string identifier for this provider type.

Public methods

getCredential

public static @NonNullAuthCredential getCredential(@NonNullString email, @NonNullString password)

Returns a new instance ofAuthCredential that wraps a given email and password. Used when callingsignInWithCredential orlinkWithCredential.

getCredentialWithLink

public static @NonNullAuthCredential getCredentialWithLink(@NonNullString email, @NonNullString emailLink)

Returns a new instance ofAuthCredential that wraps an email sign-in link. Used when callingsignInWithCredential orlinkWithCredential.

Exceptions
Parameters
@NonNullString email

the email to which theemailLink was sent

@NonNullString emailLink

a link generated bysendSignInLinkToEmail

Returns
@NonNullAuthCredential

anAuthCredential that wraps the givenemail andemailLink. Used when callingsignInWithCredential,linkWithCredential, orreauthenticate.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.