# EmailAuthProvider


```
class EmailAuthProvider
```

<br />

*** ** * ** ***

Represents the email and password authentication mechanism. Use this class to obtain instances of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/EmailAuthCredential`.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/EmailAuthProvider#EMAIL_LINK_SIGN_IN_METHOD() = "emailLink"` Unique string identifier for email/link sign-in method. |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/EmailAuthProvider#EMAIL_PASSWORD_SIGN_IN_METHOD() = "password"` Unique string identifier for email/password sign-in method. |
| `const https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/EmailAuthProvider#PROVIDER_ID() = "password"` Unique string identifier for this provider type. |

| ### Public functions |
|---|---|
| `java-static https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/AuthCredential` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/EmailAuthProvider#getCredential(java.lang.String,java.lang.String)(email: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, password: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Returns a new instance of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/AuthCredential` that wraps a given email and password. |
| `java-static https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/AuthCredential` | `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/EmailAuthProvider#getCredentialWithLink(java.lang.String,java.lang.String)(email: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, emailLink: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Returns a new instance of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/AuthCredential` that wraps an email sign-in link. |

## Constants

### EMAIL_LINK_SIGN_IN_METHOD

```
const val EMAIL_LINK_SIGN_IN_METHOD = "emailLink": String!
```

Unique string identifier for email/link sign-in method. Indicates the signin methods `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/FirebaseAuth#signInWithEmailLink(java.lang.String,java.lang.String)` and `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/FirebaseAuth#signInWithCredential(com.google.firebase.auth.AuthCredential)` with an `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/EmailAuthCredential` generated by `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/EmailAuthProvider#getCredentialWithLink(java.lang.String,java.lang.String)`.

### EMAIL_PASSWORD_SIGN_IN_METHOD

```
const val EMAIL_PASSWORD_SIGN_IN_METHOD = "password": String!
```

Unique string identifier for email/password sign-in method. Indicates the signin methods `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/FirebaseAuth#signInWithEmailAndPassword(java.lang.String,java.lang.String)` and `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/FirebaseAuth#signInWithCredential(com.google.firebase.auth.AuthCredential)` with an `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/EmailAuthCredential` generated by `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/EmailAuthProvider#getCredential(java.lang.String,java.lang.String)`.

### PROVIDER_ID

```
const val PROVIDER_ID = "password": String!
```

Unique string identifier for this provider type.

## Public functions

### getCredential

```
java-static fun getCredential(email: String, password: String): AuthCredential
```

Returns a new instance of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/AuthCredential` that wraps a given email and password. Used when calling `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/FirebaseAuth#signInWithCredential(com.google.firebase.auth.AuthCredential)` or `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/FirebaseUser#linkWithCredential(com.google.firebase.auth.AuthCredential)`.

### getCredentialWithLink

```
java-static fun getCredentialWithLink(email: String, emailLink: String): AuthCredential
```

Returns a new instance of `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/AuthCredential` that wraps an email sign-in link. Used when calling `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/FirebaseAuth#signInWithCredential(com.google.firebase.auth.AuthCredential)` or `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/FirebaseUser#linkWithCredential(com.google.firebase.auth.AuthCredential)`.
Exceptions

- `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` thrown if the `emailLink` doesn't conform to the expectations checked in `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/FirebaseAuth#isSignInWithEmailLink(java.lang.String)`

| Parameters |
|---|---|
| `email: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | the email to which the `emailLink` was sent |
| `emailLink: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | a link generated by `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/FirebaseAuth#sendSignInLinkToEmail(java.lang.String,com.google.firebase.auth.ActionCodeSettings)` |

| Returns |
|---|---|
| `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/AuthCredential` | an `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/AuthCredential` that wraps the given `email` and `emailLink`. Used when calling `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/FirebaseAuth#signInWithCredential(com.google.firebase.auth.AuthCredential)`, `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/FirebaseUser#linkWithCredential(com.google.firebase.auth.AuthCredential)`, or `https://firebase.google.com/docs/reference/kotlin/com/google/firebase/auth/FirebaseUser#reauthenticate(com.google.firebase.auth.AuthCredential)`. |