Home > @firebase/auth > EmailAuthProvider > credential
EmailAuthProvider.credential() method
Initialize an AuthCredential using an email and password.
Signature:
static credential(email: string, password: string): EmailAuthCredential;
Parameters
Parameter | Type | Description |
---|---|---|
string | Email address. | |
password | string | User account password. |
Returns:
The auth provider credential.
Example 1
const authCredential = EmailAuthProvider.credential(email, password);
const userCredential = await signInWithCredential(auth, authCredential);
Example 2
const userCredential = await signInWithEmailAndPassword(auth, email, password);