docs-devsite/auth.samlauthprovider.md
Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
An AuthProvider for SAML.
<b>Signature:</b>
export declare class SAMLAuthProvider extends FederatedAuthProvider
<b>Extends:</b> FederatedAuthProvider
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(providerId) | Constructor. The providerId must start with "saml." |
| Method | Modifiers | Description |
|---|---|---|
| credentialFromError(error) | <code>static</code> | Used to extract the underlying OAuthCredential from a AuthError which was thrown during a sign-in, link, or reauthenticate operation. |
| credentialFromJSON(json) | <code>static</code> | Creates an AuthCredential from a JSON string or a plain object. |
| credentialFromResult(userCredential) | <code>static</code> | Generates an AuthCredential from a UserCredential after a successful SAML flow completes. |
Constructor. The providerId must start with "saml."
<b>Signature:</b>
constructor(providerId: string);
| Parameter | Type | Description |
|---|---|---|
| providerId | string | SAML provider ID. |
Used to extract the underlying OAuthCredential from a AuthError which was thrown during a sign-in, link, or reauthenticate operation.
<b>Signature:</b>
static credentialFromError(error: FirebaseError): AuthCredential | null;
| Parameter | Type | Description |
|---|---|---|
| error | FirebaseError |
<b>Returns:</b>
AuthCredential | null
Creates an AuthCredential from a JSON string or a plain object.
<b>Signature:</b>
static credentialFromJSON(json: string | object): AuthCredential;
| Parameter | Type | Description |
|---|---|---|
| json | string | object | A plain object or a JSON string |
<b>Returns:</b>
Generates an AuthCredential from a UserCredential after a successful SAML flow completes.
For example, to get an AuthCredential<!-- -->, you could write the following code:
const userCredential = await signInWithPopup(auth, samlProvider);
const credential = SAMLAuthProvider.credentialFromResult(userCredential);
<b>Signature:</b>
static credentialFromResult(userCredential: UserCredential): AuthCredential | null;
| Parameter | Type | Description |
|---|---|---|
| userCredential | UserCredential | The user credential. |
<b>Returns:</b>
AuthCredential | null