Constructor

SAMLAuthProvider

new SAMLAuthProvider(providerId)

Generic SAML Auth provider.

This class requires Cloud Identity for Customers and Partners (CICP). To learn more about CICP, including pricing and features, see the CICP documentation.

On successful sign-in with SAML providers, additional user attributes associated with the IdP can be securely retrieved from the user’s ID token by checking the firebase.sign_in_attributes claim.

Parameter

providerId

string

The associated provider ID, such as saml.myProvider. All SAML provider IDs must be prefixed with saml..

Implements
firebase.auth.AuthProvider
See also
firebase.auth.Auth#onAuthStateChanged to receive sign in state changes.

Examples

// Using a redirect.
firebase.auth().getRedirectResult().then(function(result) {
  // User is signed in.
  // IdP data available in result.additionalUserInfo.profile,
  // or from the user’s ID token obtained via result.user.getIdToken()
  // as an object in the firebase.sign_in_attributes custom claim
  // This is also available via result.user.getIdTokenResult()
  // idTokenResult.claims.firebase.sign_in_attributes.
  var user = result.user;
  // Additional user info are also available via result.additionalUserInfo.
  var additionalUserInfo = result.additionalUserInfo;
});

// Start a sign in process for an unauthenticated user.
var provider = new firebase.auth.SAMLAuthProvider('saml.myProvider');
firebase.auth().signInWithRedirect(provider);
// Using a popup.
var provider = new firebase.auth.SAMLAuthProvider('saml.myProvider');
firebase.auth().signInWithPopup(provider).then(function(result) {
  // User is signed in.
  // IdP data available in result.additionalUserInfo.profile,
  // or from the user’s ID token obtained via result.user.getIdToken()
  // as an object in the firebase.sign_in_attributes custom claim
  // This is also available via result.user.getIdTokenResult()
  // idTokenResult.claims.firebase.sign_in_attributes.
  // Additional user info are also available via result.additionalUserInfo.
  var additionalUserInfo = result.additionalUserInfo;
});

Property

providerId

string

Implements
firebase.auth.AuthProvider#providerId