The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/auth > SAMLAuthProvider > credentialFromResult

SAMLAuthProvider.credentialFromResult() method

Generates an AuthCredential from a UserCredential after a successful SAML flow completes.

Signature:

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

Parameters

Parameter Type Description
userCredential UserCredential

Returns:

AuthCredential | null

Description

For example, to get an AuthCredential, you could write the following code:

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