Back to Firebase Js Sdk

SAMLAuthProvider class

docs-devsite/auth.samlauthprovider.md

12.12.14.0 KB
Original Source

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 %}

SAMLAuthProvider class

An AuthProvider for SAML.

<b>Signature:</b>

typescript
export declare class SAMLAuthProvider extends FederatedAuthProvider 

<b>Extends:</b> FederatedAuthProvider

Constructors

ConstructorModifiersDescription
(constructor)(providerId)Constructor. The providerId must start with "saml."

Methods

MethodModifiersDescription
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.

SAMLAuthProvider.(constructor)

Constructor. The providerId must start with "saml."

<b>Signature:</b>

typescript
constructor(providerId: string);

Parameters

ParameterTypeDescription
providerIdstringSAML provider ID.

SAMLAuthProvider.credentialFromError()

Used to extract the underlying OAuthCredential from a AuthError which was thrown during a sign-in, link, or reauthenticate operation.

<b>Signature:</b>

typescript
static credentialFromError(error: FirebaseError): AuthCredential | null;

Parameters

ParameterTypeDescription
errorFirebaseError

<b>Returns:</b>

AuthCredential | null

SAMLAuthProvider.credentialFromJSON()

Creates an AuthCredential from a JSON string or a plain object.

<b>Signature:</b>

typescript
static credentialFromJSON(json: string | object): AuthCredential;

Parameters

ParameterTypeDescription
jsonstring | objectA plain object or a JSON string

<b>Returns:</b>

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:

js
const userCredential = await signInWithPopup(auth, samlProvider);
const credential = SAMLAuthProvider.credentialFromResult(userCredential);

<b>Signature:</b>

typescript
static credentialFromResult(userCredential: UserCredential): AuthCredential | null;

Parameters

ParameterTypeDescription
userCredentialUserCredentialThe user credential.

<b>Returns:</b>

AuthCredential | null