SAMLAuthProvider class
Stay organized with collections
Save and categorize content based on your preferences.
An AuthProvider for SAML.
Signature:
export declare class SAMLAuthProvider extends FederatedAuthProvider
Extends: FederatedAuthProvider
Constructors
Methods
SAMLAuthProvider.(constructor)
Constructor. The providerId must start with "saml."
Signature:
constructor(providerId: string);
Parameters
Parameter |
Type |
Description |
providerId |
string |
SAML provider ID. |
SAMLAuthProvider.credentialFromError()
Used to extract the underlying OAuthCredential from a AuthError which was thrown during a sign-in, link, or reauthenticate operation.
Signature:
static credentialFromError(error: FirebaseError): AuthCredential | null;
Parameters
Returns:
AuthCredential | null
SAMLAuthProvider.credentialFromJSON()
Creates an AuthCredential from a JSON string or a plain object.
Signature:
static credentialFromJSON(json: string | object): AuthCredential;
Parameters
Parameter |
Type |
Description |
json |
string | object |
A plain object or a JSON string |
Returns:
AuthCredential
SAMLAuthProvider.credentialFromResult()
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);
Signature:
static credentialFromResult(userCredential: UserCredential): AuthCredential | null;
Parameters
Parameter |
Type |
Description |
userCredential |
UserCredential |
The user credential. |
Returns:
AuthCredential | null
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-01-19 UTC.
[null,null,["Last updated 2024-01-19 UTC."],[],[],null,["# SAMLAuthProvider class\n\nAn [AuthProvider](./auth.authprovider.md#authprovider_interface) for SAML.\n\n**Signature:** \n\n export declare class SAMLAuthProvider extends FederatedAuthProvider \n\n**Extends:** FederatedAuthProvider\n\nConstructors\n------------\n\n| Constructor | Modifiers | Description |\n|-------------------------------------------------------------------------------------|-----------|-----------------------------------------------------|\n| [(constructor)(providerId)](./auth.samlauthprovider.md#samlauthproviderconstructor) | | Constructor. The providerId must start with \"saml.\" |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|---------------------------------------------------------------------------------------------------------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [credentialFromError(error)](./auth.samlauthprovider.md#samlauthprovidercredentialfromerror) | `static` | Used to extract the underlying [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) from a [AuthError](./auth.autherror.md#autherror_interface) which was thrown during a sign-in, link, or reauthenticate operation. |\n| [credentialFromJSON(json)](./auth.samlauthprovider.md#samlauthprovidercredentialfromjson) | `static` | Creates an [AuthCredential](./auth.authcredential.md#authcredential_class) from a JSON string or a plain object. |\n| [credentialFromResult(userCredential)](./auth.samlauthprovider.md#samlauthprovidercredentialfromresult) | `static` | Generates an [AuthCredential](./auth.authcredential.md#authcredential_class) from a [UserCredential](./auth.usercredential.md#usercredential_interface) after a successful SAML flow completes. |\n\nSAMLAuthProvider.(constructor)\n------------------------------\n\nConstructor. The providerId must start with \"saml.\"\n\n**Signature:** \n\n constructor(providerId: string);\n\n#### Parameters\n\n| Parameter | Type | Description |\n|------------|--------|-------------------|\n| providerId | string | SAML provider ID. |\n\nSAMLAuthProvider.credentialFromError()\n--------------------------------------\n\nUsed to extract the underlying [OAuthCredential](./auth.oauthcredential.md#oauthcredential_class) from a [AuthError](./auth.autherror.md#autherror_interface) which was thrown during a sign-in, link, or reauthenticate operation.\n\n**Signature:** \n\n static credentialFromError(error: FirebaseError): AuthCredential | null;\n\n#### Parameters\n\n| Parameter | Type | Description |\n|-----------|--------------------------------------------------------------|-------------|\n| error | [FirebaseError](./util.firebaseerror.md#firebaseerror_class) | |\n\n**Returns:**\n\n[AuthCredential](./auth.authcredential.md#authcredential_class) \\| null\n\nSAMLAuthProvider.credentialFromJSON()\n-------------------------------------\n\nCreates an [AuthCredential](./auth.authcredential.md#authcredential_class) from a JSON string or a plain object.\n\n**Signature:** \n\n static credentialFromJSON(json: string | object): AuthCredential;\n\n#### Parameters\n\n| Parameter | Type | Description |\n|-----------|------------------|---------------------------------|\n| json | string \\| object | A plain object or a JSON string |\n\n**Returns:**\n\n[AuthCredential](./auth.authcredential.md#authcredential_class)\n\nSAMLAuthProvider.credentialFromResult()\n---------------------------------------\n\nGenerates an [AuthCredential](./auth.authcredential.md#authcredential_class) from a [UserCredential](./auth.usercredential.md#usercredential_interface) after a successful SAML flow completes.\n\nFor example, to get an [AuthCredential](./auth.authcredential.md#authcredential_class), you could write the following code: \n\n const userCredential = await signInWithPopup(auth, samlProvider);\n const credential = SAMLAuthProvider.credentialFromResult(userCredential);\n\n**Signature:** \n\n static credentialFromResult(userCredential: UserCredential): AuthCredential | null;\n\n#### Parameters\n\n| Parameter | Type | Description |\n|----------------|---------------------------------------------------------------------|----------------------|\n| userCredential | [UserCredential](./auth.usercredential.md#usercredential_interface) | The user credential. |\n\n**Returns:**\n\n[AuthCredential](./auth.authcredential.md#authcredential_class) \\| null"]]