Skip to content

Latest commit

 

History

History
119 lines (77 loc) · 3.99 KB

auth.samlauthprovider.md

File metadata and controls

119 lines (77 loc) · 3.99 KB

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.

Signature:

exportdeclareclassSAMLAuthProviderextendsFederatedAuthProvider

Extends: FederatedAuthProvider

Constructors

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

Methods

MethodModifiersDescription
credentialFromError(error)staticUsed to extract the underlying OAuthCredential from a AuthError which was thrown during a sign-in, link, or reauthenticate operation.
credentialFromJSON(json)staticCreates an AuthCredential from a JSON string or a plain object.
credentialFromResult(userCredential)staticGenerates an AuthCredential from a UserCredential after a successful SAML flow completes.

SAMLAuthProvider.(constructor)

Constructor. The providerId must start with "saml."

Signature:

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.

Signature:

staticcredentialFromError(error: FirebaseError): AuthCredential|null;

Parameters

ParameterTypeDescription
errorFirebaseError

Returns:

AuthCredential | null

SAMLAuthProvider.credentialFromJSON()

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

Signature:

staticcredentialFromJSON(json: string|object): AuthCredential;

Parameters

ParameterTypeDescription
jsonstring | objectA 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:

constuserCredential=awaitsignInWithPopup(auth,samlProvider);constcredential=SAMLAuthProvider.credentialFromResult(userCredential);

Signature:

staticcredentialFromResult(userCredential: UserCredential): AuthCredential|null;

Parameters

ParameterTypeDescription
userCredentialUserCredentialThe user credential.

Returns:

AuthCredential | null

close