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.
Signature:
exportdeclareclassSAMLAuthProviderextendsFederatedAuthProvider
Extends: FederatedAuthProvider
Constructor | Modifiers | Description |
---|---|---|
(constructor)(providerId) | Constructor. The providerId must start with "saml." |
Method | Modifiers | Description |
---|---|---|
credentialFromError(error) | static | Used to extract the underlying OAuthCredential from a AuthError which was thrown during a sign-in, link, or reauthenticate operation. |
credentialFromJSON(json) | static | Creates an AuthCredential from a JSON string or a plain object. |
credentialFromResult(userCredential) | static | Generates an AuthCredential from a UserCredential after a successful SAML flow completes. |
Constructor. The providerId must start with "saml."
Signature:
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.
Signature:
staticcredentialFromError(error: FirebaseError): AuthCredential|null;
Parameter | Type | Description |
---|---|---|
error | FirebaseError |
Returns:
AuthCredential | null
Creates an AuthCredential from a JSON string or a plain object.
Signature:
staticcredentialFromJSON(json: string|object): AuthCredential;
Parameter | Type | Description |
---|---|---|
json | string | object | A plain object or a JSON string |
Returns:
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;
Parameter | Type | Description |
---|---|---|
userCredential | UserCredential | The user credential. |
Returns:
AuthCredential | null