SAML v2 API

On this page
Available since 1.6.0

A SAML v2 Identity Provider connects FusionAuth to an external SAML v2 login system. FusionAuth can show a Login with ... button for the Identity Provider on the FusionAuth login page. The properties of the Identity Provider control the button.

A SAML v2 Identity Provider can list one or more domains. Domains let employees log in with corporate credentials from any company identity solution that supports SAML v2. FusionAuth calls an Identity Provider with domains a Domain Based Identity Provider. When an Identity Provider has domains, the FusionAuth login page hides the Login with ... button and shows only the email field at first. After the user enters an email address, FusionAuth compares the domain of the address to the domains of the Identity Provider. FusionAuth then logs the user in locally, or redirects the user to the Identity Provider.

FusionAuth reads the email address, unique Id, and username of the user from the SAML assertionA signed XML statement from an identity provider that tells a service provider who the user is and which attributes the user has., based on the claim fields of the Identity Provider. The linking strategy decides how FusionAuth matches the user. To use other claims from the SAML response, assign a SAML v2 Reconcile Lambda to the Identity Provider.

Integration Details#

FusionAuth generates the following URLs for each SAML v2 Identity Provider:

  • Callback URL (ACS): <base_url>/samlv2/acs
  • IdP Initiated Callback URLs (ACS): <base_url>/samlv2/acs/<identityProviderId>/<clientId>
  • Issuer: <base_url>/samlv2/sp/<identityProviderId>, unless you set identityProvider.issuer
  • Metadata URL: <base_url>/samlv2/sp/metadata/<identityProviderId>

For a description of each value, see Integration Details.

Create a SAML v2 Identity Provider#

Request#

Create a SAML v2 Identity Provider with a random Id, or with an Id that you provide in the URI.

API Key Authentication
Create a SAML v2 Identity Provider using a randomly generated Id
POST/api/identity-provider
OpenAPI Spec
API Key Authentication
Create a SAML v2 Identity Provider with a provided Id
POST/api/identity-provider/{identityProviderId}
OpenAPI Spec

Set identityProvider.type to SAMLv2 in the request JSON.

Path Parameters#

identityProviderId
  • Type: UUID
  • Optional
  • Defaults to secure random UUID
  • Immutable

The Id of the new Identity Provider. When you leave out the Id, FusionAuth generates a secure random UUID.

Request Body#
identityProvider.applicationConfiguration
  • Type: Map<UUID, Object>
  • Optional

The configuration for each Application that the Identity Provider is enabled for.

Available since 1.70.0 To enable this Identity Provider for CIMD clients, use the Id of a CIMD domain as the key. FusionAuth then enables the IdP for every client that registers through that domain.

identityProvider.applicationConfiguration[applicationId].buttonImageURL
  • Type: String
  • Optional

An optional Application-specific override for the top-level buttonImageURL.

identityProvider.applicationConfiguration[applicationId].buttonText
  • Type: String
  • Optional

An optional Application-specific override for the top-level buttonText.

identityProvider.applicationConfiguration[applicationId].createRegistration
  • Type: Boolean
  • Optional
  • Defaults to true

Whether FusionAuth registers the User for the Application automatically. When true and a User with no Registration for the Application logs in through the Identity Provider, FusionAuth creates the Registration.

For a CIMD domain Id, this value is always false, because FusionAuth doesn't register Users for CIMD clients. Available since 1.70.0

identityProvider.applicationConfiguration[applicationId].enabled
  • Type: Boolean
  • Optional
  • Defaults to false

Whether this Identity Provider is enabled for the Application that the applicationId key specifies.

Available since 1.70.0 When identityProvider.idpInitiatedConfiguration.enabled is true, this value must be false for a CIMD domain Id. IdP-initiated login doesn't support CIMD clients.

identityProvider.assertionConfiguration.destination.alternates
  • Type: Array
  • Optional
  • Available since 1.43.0

The URLs that FusionAuth accepts as SAML login destinations when identityProvider.assertionConfiguration.destination.policy is AllowAlternates.

identityProvider.assertionConfiguration.destination.policy
  • Type: String
  • Optional
  • Defaults to Enabled
  • Available since 1.43.0

The policy for the destination assertion on the SAML login request. The possible values are:

  • Enabled: FusionAuth verifies that the Destination attribute in the SAML response equals the expected destination. The FusionAuth hosted login pages expect the FusionAuth ACS (Assertion Consumer Service) URL. The Start a SAML v2 Login Request API expects data.samlDestination. Enabled is the default and the recommended setting.
  • Disabled: FusionAuth doesn't validate the Destination attribute. FusionAuth doesn't recommend this setting.
  • AllowAlternates: FusionAuth verifies that the Destination attribute is either the FusionAuth ACS or one of the values in identityProvider.assertionConfiguration.destination.alternates. Use this setting with caution, to help migrate from a third-party IdP.
identityProvider.assertionDecryptionConfiguration.enabled
  • Type: Boolean
  • Optional
  • Defaults to false
  • Available since 1.55.1

Whether FusionAuth requires encrypted assertions in SAML responses from the Identity Provider.

When true, FusionAuth rejects a SAML response from the IdP that contains an unencrypted assertion.

identityProvider.assertionDecryptionConfiguration.keyTransportDecryptionKeyId
  • Type: UUID
  • Optional
  • Available since 1.55.1

The Id of the key in Key Master that decrypts the symmetric key on SAML responses from the Identity Provider. The Key must contain an RSA private key.

This field is required when identityProvider.assertionDecryptionConfiguration.enabled is true.

identityProvider.buttonImageURL
  • Type: String
  • Optional

The URL of the top-level button image on the FusionAuth login page for this Identity Provider.

identityProvider.buttonText
  • Type: String
  • Optional
  • Defaults to Login with SAML

The top-level button text on the FusionAuth login page for this Identity Provider.

identityProvider.attributeMappings
  • Type: Map<String, String>
  • Optional
  • Available since 1.65.0

A map of attribute mappings that FusionAuth applies during user reconciliation when the Identity Provider has no reconcile Lambda. The default is an empty map.

Each key is a FusionAuth target field path. Each key must begin with user. or registration.. FusionAuth ignores a key with any other prefix. Each value is a source expression in the payload of the IdP response. FusionAuth converts a dot-notated value, such as email or id_token.given_name, to a JSON Pointer. FusionAuth uses a value that starts with / as a JSON Pointer without changes.

You can't use this field with identityProvider.lambdaConfiguration.reconcileId.

When identityProvider.linkingStrategy is LinkAnonymously, FusionAuth ignores this field.

FusionAuth ignores a mapping that resolves to null, that FusionAuth can't extract, or that FusionAuth can't write to the target field. A mapping to user.password doesn't set a password.

identityProvider.debug
  • Type: Boolean
  • Optional
  • Defaults to false
  • Available since 1.7.3

Whether debug is enabled for the Identity Provider. When true, FusionAuth creates an Event Log each time FusionAuth reconciles a login through the Identity Provider.

Turn on debug while you build an integration or troubleshoot an issue with this IdP. Turn off debug in production.

identityProvider.domains
  • Type: Array<String>
  • Optional

An optional list of domains that use this SAML v2 Identity Provider. A list of domains turns the FusionAuth login form into a domain-based login form, which first asks the user for an email address. FusionAuth uses the email address to decide whether to use an Identity Provider. When FusionAuth uses an IdP, FusionAuth redirects the browser to the login URL of the IdP. Otherwise, the form shows the password field, and the user logs in with FusionAuth.

identityProvider.emailClaim
  • Type: String
  • Optional

The name of the email claim (an attribute in the Assertion element) in the SAML response that contains the email address of the user.

When identityProvider.useNameIdForEmail is false, set this field. Otherwise, FusionAuth gets no email address from the SAML response.

identityProvider.enabled
  • Type: Boolean
  • Optional
  • Defaults to false

Whether this Identity Provider is enabled. When false, FusionAuth disables the IdP globally.

identityProvider.idpEndpoint
  • Type: String
  • Required

The URL of the SAML v2 login page of the Identity Provider. The value must be a valid URL.

identityProvider.idpInitiatedConfiguration.enabled
  • Type: Boolean
  • Optional
  • Defaults to false
  • Available since 1.43.0

Whether FusionAuth accepts IdP-initiated login requests from this SAML v2 Identity Provider. IdP-initiated login requires a valid license.

FusionAuth doesn't recommend this type of login, because an unsolicited authentication response from a third-party Identity Provider (IdP) carries risk.

In an SP-initiated login, FusionAuth is the service provider (SP), and receives the SAML Authentication Response in reply to an authentication request. FusionAuth can then validate certain parameters, and accept only a response to a request that FusionAuth started. In an IdP-initiated login, the third-party IdP sends FusionAuth a SAML Authentication Response without any request or context. FusionAuth didn't start the login, so FusionAuth can verify less, and must allow a cross-site request from the third party.

When you need this type of login for a legacy integration, or when the user experience matters most, you can enable the feature.

identityProvider.idpInitiatedConfiguration.issuer
  • Type: String
  • Optional
  • Available since 1.43.0

The EntityId (unique identifier) of the SAML v2 Identity Provider. The IdP gives you this value.

This field is required when identityProvider.idpInitiatedConfiguration.enabled is true.

identityProvider.issuer
  • Type: String
  • Optional

The EntityId (unique identifier) that FusionAuth uses as the SAML service provider.

When you leave out the value, FusionAuth uses the default service provider EntityId, {'<base_url>/samlv2/sp/<identityProviderId>'}.

When you provide the value, the value can't be an empty string.

identityProvider.keyId
  • Type: UUID
  • Optional
  • Deprecated

The Id of the key in Key Master that verifies the signature on SAML responses from the Identity Provider.

Deprecated since 1.69.0

In version 1.69.0 and later, use identityProvider.verificationKeyIds. For backward compatibility, FusionAuth sets identityProvider.keyId to the first entry in identityProvider.verificationKeyIds in responses. When a request sets identityProvider.keyId and leaves out identityProvider.verificationKeyIds, FusionAuth adds identityProvider.keyId to identityProvider.verificationKeyIds.

identityProvider.lambdaConfiguration.reconcileId
  • Type: UUID
  • Optional

The Id of a SAML reconcile lambda that FusionAuth runs when the Identity Provider returns a successful SAML response.

The Lambda must be of type SAMLv2Reconcile.

identityProvider.linkingStrategy
  • Type: String
  • Optional
  • Defaults to LinkByEmail
  • Available since 1.28.0

The strategy that FusionAuth uses to link the SAML v2 Identity Provider to the User.

Available since 1.65.0 You can only change this value when the identity provider is disabled. To change the linking strategy for an identity provider that is already enabled, disable the provider, change the value, and then re-enable the provider.

The possible values are:

  • CreatePendingLink: FusionAuth doesn't link automatically. FusionAuth returns a pending link Id. Use the pending link Id to link to an existing User.
  • Disabled: FusionAuth doesn't link automatically. You must create Links with the API. Available since 1.37.0
  • LinkAnonymously: FusionAuth always creates a Link based on the unique Id that the IdP returns. FusionAuth doesn't require a username or email address, and doesn't use a username or email address to link the User. FusionAuth doesn't run a reconcile Lambda.
  • LinkByEmail: FusionAuth links to an existing User by email address. When no User has the email address that the IdP returns, FusionAuth creates a User with that email address.
  • LinkByEmailForExistingUser: FusionAuth links only to an existing User by email address. When no User has the email address that the IdP returns, FusionAuth doesn't create a User.
  • LinkByUsername: FusionAuth links to an existing User by username. When no User has the username that the IdP returns, FusionAuth creates a User with that username.
  • LinkByUsernameForExistingUser: FusionAuth links only to an existing User by username. When no User has the username that the IdP returns, FusionAuth doesn't create a User.
identityProvider.loginHintConfiguration.enabled
  • Type: Boolean
  • Optional
  • Defaults to true
  • Available since 1.43.0

When true and the AuthN request uses HTTP-Redirect bindings, FusionAuth sends the username or email address to the IdP as a login hint, when available. FusionAuth sends the hint in the parameter that identityProvider.loginHintConfiguration.parameterName names.

identityProvider.loginHintConfiguration.parameterName
  • Type: String
  • Optional
  • Defaults to login_hint
  • Available since 1.43.0

The name of the parameter that passes the username or email address to the IdP as a login hint. FusionAuth sends the parameter when identityProvider.loginHintConfiguration.enabled is true and the AuthN request uses HTTP-Redirect bindings.

This field is required when identityProvider.loginHintConfiguration.enabled is true.

identityProvider.name
  • Type: String
  • Required

The name of this SAML v2 Identity Provider. FusionAuth uses the name for display only. The name must be unique across all Identity Providers.

identityProvider.nameIdFormat
  • Type: String
  • Optional
  • Defaults to urn:oasis:names:tc:SAML:2.0:nameid-format:persistent

The Name Id format to request. A Service Provider (SP) and an Identity Provider (IdP) use the Name Id to refer to a user. The SP sets the preferred format in the AuthN request, and the IdP tries to use that format in the AuthN response.

identityProvider.postRequest
  • Type: Boolean
  • Optional
  • Available since 1.20.0

When true, FusionAuth sends the authentication request with the HTTP POST binding. Otherwise, FusionAuth uses the default Redirect binding, which uses the HTTP GET method.

identityProvider.requestSigningKeyId
  • Type: UUID
  • Optional
  • Available since 1.20.0

The Id of the key pair that signs the SAML request.

This field is required when identityProvider.signRequest is true.

identityProvider.signRequest
  • Type: Boolean
  • Optional
  • Available since 1.20.0

When true, FusionAuth signs the authentication requests that FusionAuth sends to the IdP.

identityProvider.source
  • Type: String
  • Optional
  • Defaults to System
  • Available since 1.65.0

The source of this Identity Provider.

The maximum length is 191 characters.

FusionAuth sets the source only on create. On update, FusionAuth ignores the value and keeps the existing source.

identityProvider.tenantConfiguration
  • Type: Map<UUID, Object>
  • Available since 1.32.0

The configuration for each Tenant that limits the number of Links a User can have for this Identity Provider.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount
  • Type: Object
  • Available since 1.32.0

The policy for Identity Provider Links in the Tenant.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount.enabled
  • Type: Boolean
  • Defaults to false
  • Available since 1.32.0

When true, FusionAuth limits the number of Links a User can create to maximumLinks.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount.maximumLinks
  • Type: Integer
  • Defaults to 42
  • Available since 1.32.0

The maximum number of Links a User can have for this Identity Provider. The limit applies only to this IdP, so a User can have more Links across all Identity Providers. The value must be greater than 0.

identityProvider.tenantId
  • Type: UUID
  • Optional
  • Available since 1.62.0

The unique Id of the Tenant.

When you provide a value, FusionAuth creates an Identity Provider scoped to the Tenant. Otherwise, FusionAuth creates a global IdP. A Tenant-scoped IdP authenticates users only in the context of the Tenant. A global IdP works with any Tenant.

You can't change the value after you create the Identity Provider.

identityProvider.type
  • Type: String
  • Required

The type of the Identity Provider. Set the value to SAMLv2.

identityProvider.uniqueIdClaim
  • Type: String
  • Optional

The name of the attribute in the SAML response that contains the unique Id of the user. FusionAuth uses the unique Id to link the user to this Identity Provider. When you leave out the value, FusionAuth uses the NameID value.

identityProvider.useNameIdForEmail
  • Type: Boolean
  • Optional
  • Defaults to false

Whether FusionAuth uses the value of the NameID element as the email address of the user during reconciliation. When false, set identityProvider.emailClaim.

identityProvider.usernameClaim
  • Type: String
  • Optional

The name of the attribute in the SAML response that contains the username of the user. FusionAuth never uses the NameID as the username. When you leave out the value, the user has no username unless the reconcile lambda of the IdP sets one. When identityProvider.linkingStrategy is LinkByUsername or LinkByUsernameForExistingUser, set the value, because those strategies link users by username.

identityProvider.verificationKeyIds
  • Type: Array<UUID>
  • Optional
  • Available since 1.69.0

The Ids of the keys in Key Master that verify the signature on SAML responses from the Identity Provider. FusionAuth trusts only these keys.

When the signature includes an X.509 certificate, FusionAuth uses the key whose certificate has the same SHA-1 thumbprint, wherever the key appears in the list. When the signature doesn't include a certificate, FusionAuth uses the first key in the list. A key without a certificate can verify a response only as the first key. For more information, see SAML v2 Signature Verification.

This field is required when you don't set the deprecated identityProvider.keyId.

Versions before 1.69.0 don't have this field. Use identityProvider.keyId instead.

identityProvider.xmlSignatureC14nMethod
  • Type: String
  • Optional
  • Available since 1.20.0

The XML signature canonicalization method that FusionAuth uses to digest and sign the SAML request.

This field is required when identityProvider.signRequest and identityProvider.postRequest are true.

The possible values are:

  • exclusive: The URI for this method is http://www.w3.org/2001/10/xml-exc-c14n#
  • exclusive_with_comments: The URI for this method is http://www.w3.org/2001/10/xml-exc-c14n#WithComments
  • inclusive: The URI for this method is http://www.w3.org/TR/2001/REC-xml-c14n-20010315
  • inclusive_with_comments: The URI for this method is http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments
Example SAML v2 Request JSON
{
  "identityProvider": {
    "applicationConfiguration": {
      "2c73b816-f48c-4c36-964b-40589a9ae629": {
        "buttonText": "Login with SAML (app text)",
        "createRegistration": true,
        "enabled": true
      }
    },
    "assertionConfiguration": {
      "destination": {
        "alternates": [],
        "policy": "Enabled"
      }
    },
    "assertionDecryptionConfiguration": {
      "enabled": true,
      "keyTransportDecryptionKeyId": "ce0ca33d-3555-4b89-9777-0ef1276f7b26"
    },
    "buttonText": "Login with SAML",
    "debug": false,
    "emailClaim": "email",
    "enabled": true,
    "idpEndpoint": "https://www.example.com/login",
    "idpInitiatedConfiguration": {
      "enabled": false,
      "issuer": "https://www.example.com"
    },
    "lambdaConfiguration": {
      "reconcileId": "0bf07e2d-08fa-4d56-8f63-9f9d40ee7fd5"
    },
    "linkingStrategy": "LinkByEmail",
    "loginHintConfiguration": {
      "enabled": true,
      "parameterName": "login_hint"
    },
    "name": "My SAML provider",
    "nameIdFormat": "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent",
    "postRequest": true,
    "requestSigningKeyId": "3168129b-91fa-46f4-9676-947f5509fdce",
    "signRequest": true,
    "tenantConfiguration": {
      "e872a880-b14f-6d62-c312-cb40f22af465": {
        "limitUserLinkCount": {
          "enabled": false,
          "maximumLinks": 42
        }
      }
    },
    "type": "SAMLv2",
    "verificationKeyIds": [
      "a60f46c9-5d8e-48af-ac23-dbaa00579c57",
      "6a3a08d9-137e-40fc-83ad-6e50afcfdae4"
    ],
    "xmlSignatureC14nMethod": "exclusive",
    "uniqueIdClaim": "userId",
    "useNameIdForEmail": true,
    "usernameClaim": "username"
  }
}
Example SAML v2 Request JSON (with issuer override)
{
  "identityProvider": {
    "applicationConfiguration": {
      "2c73b816-f48c-4c36-964b-40589a9ae629": {
        "buttonText": "Login with SAML",
        "createRegistration": true,
        "enabled": true
      }
    },
    "assertionConfiguration": {
      "destination": {
        "alternates": [],
        "policy": "Enabled"
      }
    },
    "assertionDecryptionConfiguration": {
      "enabled": true,
      "keyTransportDecryptionKeyId": "ce0ca33d-3555-4b89-9777-0ef1276f7b26"
    },
    "buttonText": "Login with SAML",
    "debug": false,
    "emailClaim": "email",
    "enabled": true,
    "idpEndpoint": "https://www.example.com/login",
    "idpInitiatedConfiguration": {
      "enabled": false,
      "issuer": "https://www.example.com"
    },
    "issuer": "https://sp.piedpiper.example.com/saml",
    "keyId": "a60f46c9-5d8e-48af-ac23-dbaa00579c57",
    "lambdaConfiguration": {
      "reconcileId": "0bf07e2d-08fa-4d56-8f63-9f9d40ee7fd5"
    },
    "linkingStrategy": "LinkByEmail",
    "loginHintConfiguration": {
      "enabled": true,
      "parameterName": "login_hint"
    },
    "name": "My SAML provider",
    "nameIdFormat": "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent",
    "postRequest": true,
    "requestSigningKeyId": "3168129b-91fa-46f4-9676-947f5509fdce",
    "signRequest": true,
    "tenantConfiguration": {
      "e872a880-b14f-6d62-c312-cb40f22af465": {
        "limitUserLinkCount": {
          "enabled": false,
          "maximumLinks": 42
        }
      }
    },
    "type": "SAMLv2",
    "xmlSignatureC14nMethod": "exclusive",
    "uniqueIdClaim": "userId",
    "useNameIdForEmail": true,
    "usernameClaim": "username"
  }
}

Response#

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
409FusionAuth found a conflict while processing the request.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response usually contains an Errors JSON object with the [Exception] general error code. On MySQL, a data field larger than the database column also returns 500. For more information, see Data Field Sizes.

Response Body#

identityProvider.applicationConfiguration
  • Type: Map<UUID, Object>

The configuration for each Application that the Identity Provider is enabled for.

Available since 1.70.0 To enable this Identity Provider for CIMD clients, use the Id of a CIMD domain as the key. FusionAuth then enables the IdP for every client that registers through that domain.

identityProvider.applicationConfiguration[applicationId].buttonImageURL
  • Type: String

An optional Application-specific override for the top-level buttonImageURL.

identityProvider.applicationConfiguration[applicationId].buttonText
  • Type: String

An optional Application-specific override for the top-level buttonText.

identityProvider.applicationConfiguration[applicationId].createRegistration
  • Type: Boolean

Whether FusionAuth registers the User for the Application automatically. When true and a User with no Registration for the Application logs in through the Identity Provider, FusionAuth creates the Registration.

For a CIMD domain Id, this value is always false, because FusionAuth doesn't register Users for CIMD clients. Available since 1.70.0

identityProvider.applicationConfiguration[applicationId].enabled
  • Type: Boolean

Whether this Identity Provider is enabled for the Application that the applicationId key specifies.

identityProvider.assertionConfiguration.destination.alternates
  • Type: Array
  • Available since 1.43.0

The URLs that FusionAuth accepts as SAML login destinations when identityProvider.assertionConfiguration.destination.policy is AllowAlternates.

identityProvider.assertionConfiguration.destination.policy
  • Type: String
  • Available since 1.43.0

The policy for the destination assertion on the SAML login request. The possible values are:

  • Enabled: FusionAuth verifies that the Destination attribute in the SAML response equals the expected destination. The FusionAuth hosted login pages expect the FusionAuth ACS (Assertion Consumer Service) URL. The Start a SAML v2 Login Request API expects data.samlDestination. Enabled is the default and the recommended setting.
  • Disabled: FusionAuth doesn't validate the Destination attribute. FusionAuth doesn't recommend this setting.
  • AllowAlternates: FusionAuth verifies that the Destination attribute is either the FusionAuth ACS or one of the values in identityProvider.assertionConfiguration.destination.alternates. Use this setting with caution, to help migrate from a third-party IdP.
identityProvider.assertionDecryptionConfiguration.enabled
  • Type: Boolean
  • Available since 1.55.1

Whether FusionAuth requires encrypted assertions in SAML responses from the Identity Provider.

When true, FusionAuth rejects a SAML response from the IdP that contains an unencrypted assertion.

identityProvider.assertionDecryptionConfiguration.keyTransportDecryptionKeyId
  • Type: UUID
  • Available since 1.55.1

The Id of the key in Key Master that decrypts the symmetric key on SAML responses from the Identity Provider. The Key must contain an RSA private key.

identityProvider.buttonImageURL
  • Type: String

The URL of the top-level button image on the FusionAuth login page for this Identity Provider.

identityProvider.buttonText
  • Type: String

The top-level button text on the FusionAuth login page for this Identity Provider.

identityProvider.attributeMappings
  • Type: Map<String, String>
  • Available since 1.65.0

A map of attribute mappings that FusionAuth applies during user reconciliation when the Identity Provider has no reconcile Lambda.

Each key is a FusionAuth target field path. Each key begins with user. or registration.. Each value is a source expression in the payload of the IdP response.

When identityProvider.linkingStrategy is LinkAnonymously, FusionAuth ignores this field.

FusionAuth ignores a mapping that resolves to null, that FusionAuth can't extract, or that FusionAuth can't write to the target field. A mapping to user.password doesn't set a password.

identityProvider.debug
  • Type: Boolean

Whether debug is enabled for the Identity Provider. When true, FusionAuth creates an Event Log each time FusionAuth reconciles a login through the Identity Provider.

identityProvider.domains
  • Type: Array<String>

An optional list of domains that use this SAML v2 Identity Provider. A list of domains turns the FusionAuth login form into a domain-based login form, which first asks the user for an email address. FusionAuth uses the email address to decide whether to use an Identity Provider. When FusionAuth uses an IdP, FusionAuth redirects the browser to the login URL of the IdP. Otherwise, the form shows the password field, and the user logs in with FusionAuth.

identityProvider.emailClaim
  • Type: String

The name of the email claim (an attribute in the Assertion element) in the SAML response that contains the email address of the user.

identityProvider.enabled
  • Type: Boolean

Whether this Identity Provider is enabled. When false, FusionAuth disables the IdP globally.

identityProvider.id
  • Type: UUID

The Id of the Identity Provider.

identityProvider.idpEndpoint
  • Type: String

The URL of the SAML v2 login page of the Identity Provider.

identityProvider.idpInitiatedConfiguration.enabled
  • Type: Boolean
  • Available since 1.43.0

Whether FusionAuth accepts IdP-initiated login requests from this SAML v2 Identity Provider. IdP-initiated login requires a valid license.

identityProvider.idpInitiatedConfiguration.issuer
  • Type: String
  • Available since 1.43.0

The EntityId (unique identifier) of the SAML v2 Identity Provider. The IdP gives you this value.

identityProvider.insertInstant
  • Type: Long

The instant that FusionAuth added the Identity Provider to the database.

identityProvider.issuer
  • Type: String

The EntityId (unique identifier) that FusionAuth uses as the SAML service provider.

When the value isn't set, FusionAuth uses {'<base_url>/samlv2/sp/<identityProviderId>'}.

identityProvider.lastUpdateInstant
  • Type: Long

The instant that FusionAuth last updated the Identity Provider in the database.

identityProvider.keyId
  • Type: UUID
  • Deprecated

The Id of the key in Key Master that verifies the signature on SAML responses from the Identity Provider.

Deprecated since 1.69.0

In version 1.69.0 and later, use identityProvider.verificationKeyIds. For backward compatibility, FusionAuth sets identityProvider.keyId to the first entry in identityProvider.verificationKeyIds.

identityProvider.lambdaConfiguration.reconcileId
  • Type: UUID

The Id of a SAML reconcile lambda that FusionAuth runs when the Identity Provider returns a successful SAML response.

identityProvider.linkingStrategy
  • Type: String
  • Available since 1.28.0

The strategy that FusionAuth uses to link the SAML v2 Identity Provider to the User.

The possible values are:

  • CreatePendingLink: FusionAuth creates a pending link.
  • Disabled: FusionAuth doesn't link automatically. Available since 1.37.0
  • LinkAnonymously: FusionAuth links by the unique Id from the IdP, without a username or email address.
  • LinkByEmail: FusionAuth links by email address, and creates a missing User.
  • LinkByEmailForExistingUser: FusionAuth links by email address, and doesn't create a missing User.
  • LinkByUsername: FusionAuth links by username, and creates a missing User.
  • LinkByUsernameForExistingUser: FusionAuth links by username, and doesn't create a missing User.
identityProvider.loginHintConfiguration.enabled
  • Type: Boolean
  • Available since 1.43.0

When true and the AuthN request uses HTTP-Redirect bindings, FusionAuth sends the username or email address to the IdP as a login hint, when available. FusionAuth sends the hint in the parameter that identityProvider.loginHintConfiguration.parameterName names.

identityProvider.loginHintConfiguration.parameterName
  • Type: String
  • Available since 1.43.0

The name of the parameter that passes the username or email address to the IdP as a login hint. FusionAuth sends the parameter when identityProvider.loginHintConfiguration.enabled is true and the AuthN request uses HTTP-Redirect bindings.

identityProvider.name
  • Type: String

The name of this SAML v2 Identity Provider. FusionAuth uses the name for display only.

identityProvider.nameIdFormat
  • Type: String

The Name Id format that FusionAuth requests. A Service Provider (SP) and an Identity Provider (IdP) use the Name Id to refer to a user. The SP sets the preferred format in the AuthN request, and the IdP tries to use that format in the AuthN response.

identityProvider.postRequest
  • Type: Boolean
  • Available since 1.20.0

When true, FusionAuth sends the authentication request with the HTTP POST binding. Otherwise, FusionAuth uses the default Redirect binding, which uses the HTTP GET method.

identityProvider.requestSigningKeyId
  • Type: UUID
  • Available since 1.20.0

The Id of the key pair that signs the SAML request.

identityProvider.signRequest
  • Type: Boolean
  • Available since 1.20.0

When true, FusionAuth signs the authentication requests that FusionAuth sends to the IdP.

identityProvider.source
  • Type: String
  • Available since 1.65.0

The source of this Identity Provider.

identityProvider.tenantConfiguration
  • Type: Map<UUID, Object>
  • Available since 1.32.0

The configuration for each Tenant that limits the number of Links a User can have for this Identity Provider.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount
  • Type: Object
  • Available since 1.32.0

The policy for Identity Provider Links in the Tenant.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount.enabled
  • Type: Boolean
  • Defaults to false
  • Available since 1.32.0

When true, FusionAuth limits the number of Links a User can create to maximumLinks.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount.maximumLinks
  • Type: Integer
  • Defaults to 42
  • Available since 1.32.0

The maximum number of Links a User can have for this Identity Provider. The limit applies only to this IdP, so a User can have more Links across all Identity Providers. The value must be greater than 0.

identityProvider.tenantId
  • Type: UUID
  • Available since 1.62.0

The unique Id of the Tenant. The response includes the value when the Identity Provider is scoped to a Tenant. A Tenant-scoped IdP authenticates users only in the context of the Tenant. You can't change the value after you create the Identity Provider.

identityProvider.type
  • Type: String

The type of the Identity Provider. The value is SAMLv2.

identityProvider.uniqueIdClaim
  • Type: String

The name of the attribute in the SAML response that contains the unique Id of the user. FusionAuth uses the unique Id to link the user to this Identity Provider. When the value isn't set, FusionAuth uses the NameID value.

identityProvider.useNameIdForEmail
  • Type: Boolean

Whether FusionAuth uses the value of the NameID element as the email address of the user during reconciliation.

identityProvider.usernameClaim
  • Type: String

The name of the attribute in the SAML response that contains the username of the user. FusionAuth never uses the NameID as the username. When the value isn't set, the user has no username unless the reconcile lambda of the IdP sets one. When identityProvider.linkingStrategy is LinkByUsername or LinkByUsernameForExistingUser, set the value, because those strategies link users by username.

identityProvider.verificationKeyIds
  • Type: Array<UUID>
  • Available since 1.69.0

The Ids of the keys in Key Master that verify the signature on SAML responses from the Identity Provider. The first key verifies responses whose signature doesn't include a certificate. For more information, see SAML v2 Signature Verification.

In versions before 1.69.0, the response contains identityProvider.keyId instead.

identityProvider.xmlSignatureC14nMethod
  • Type: String
  • Available since 1.20.0

The XML signature canonicalization method that FusionAuth uses to digest and sign the SAML request.

The possible values are:

  • exclusive: The URI for this method is http://www.w3.org/2001/10/xml-exc-c14n#
  • exclusive_with_comments: The URI for this method is http://www.w3.org/2001/10/xml-exc-c14n#WithComments
  • inclusive: The URI for this method is http://www.w3.org/TR/2001/REC-xml-c14n-20010315
  • inclusive_with_comments: The URI for this method is http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments
Example SAML v2 Response JSON
{
  "identityProvider": {
    "applicationConfiguration": {
      "2c73b816-f48c-4c36-964b-40589a9ae629": {
        "buttonText": "Login with SAML (app text)",
        "createRegistration": true,
        "enabled": true
      }
    },
    "assertionConfiguration": {
      "destination": {
        "alternates": [],
        "policy": "Enabled"
      }
    },
    "assertionDecryptionConfiguration": {
      "enabled": true,
      "keyTransportDecryptionKeyId": "ce0ca33d-3555-4b89-9777-0ef1276f7b26"
    },
    "buttonText": "Login with SAML",
    "emailClaim": "email",
    "debug": false,
    "domains": [],
    "enabled": true,
    "id": "e13afb7b-77c7-4451-9c07-897d38f4fb3d",
    "idpEndpoint": "https://www.example.com/login",
    "idpInitiatedConfiguration": {
      "enabled": false,
      "issuer": "https://www.example.com"
    },
    "insertInstant": 1595361142909,
    "lastUpdateInstant": 1595361143101,
    "keyId": "a60f46c9-5d8e-48af-ac23-dbaa00579c57",
    "lambdaConfiguration": {
      "reconcileId": "0bf07e2d-08fa-4d56-8f63-9f9d40ee7fd5"
    },
    "linkingStrategy": "LinkByEmail",
    "loginHintConfiguration": {
      "enabled": true,
      "parameterName": "login_hint"
    },
    "name": "My SAML provider",
    "nameIdFormat": "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent",
    "postRequest": true,
    "requestSigningKeyId": "3168129b-91fa-46f4-9676-947f5509fdce",
    "signRequest": true,
    "tenantConfiguration": {
      "e872a880-b14f-6d62-c312-cb40f22af465": {
        "limitUserLinkCount": {
          "enabled": false,
          "maximumLinks": 42
        }
      }
    },
    "type": "SAMLv2",
    "xmlSignatureC14nMethod": "exclusive",
    "uniqueIdClaim": "userId",
    "useNameIdForEmail": true,
    "usernameClaim": "username",
    "verificationKeyIds": [
      "a60f46c9-5d8e-48af-ac23-dbaa00579c57",
      "6a3a08d9-137e-40fc-83ad-6e50afcfdae4"
    ]
  }
}

Retrieve a SAML v2 Identity Provider#

Request#

Retrieve the SAML v2 Identity Provider by its Id.

API Key Authentication
Retrieve an Identity Provider by Id
GET/api/identity-provider/{identityProviderId}
OpenAPI Spec

Path Parameters#

identityProviderId
  • Type: UUID
  • Required

The unique Id of the SAML v2 Identity Provider to retrieve.

Response#

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
404The object you requested doesn't exist. The response is empty.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty.

Response Body#

identityProvider.applicationConfiguration
  • Type: Map<UUID, Object>

The configuration for each Application that the Identity Provider is enabled for.

Available since 1.70.0 To enable this Identity Provider for CIMD clients, use the Id of a CIMD domain as the key. FusionAuth then enables the IdP for every client that registers through that domain.

identityProvider.applicationConfiguration[applicationId].buttonImageURL
  • Type: String

An optional Application-specific override for the top-level buttonImageURL.

identityProvider.applicationConfiguration[applicationId].buttonText
  • Type: String

An optional Application-specific override for the top-level buttonText.

identityProvider.applicationConfiguration[applicationId].createRegistration
  • Type: Boolean

Whether FusionAuth registers the User for the Application automatically. When true and a User with no Registration for the Application logs in through the Identity Provider, FusionAuth creates the Registration.

For a CIMD domain Id, this value is always false, because FusionAuth doesn't register Users for CIMD clients. Available since 1.70.0

identityProvider.applicationConfiguration[applicationId].enabled
  • Type: Boolean

Whether this Identity Provider is enabled for the Application that the applicationId key specifies.

identityProvider.assertionConfiguration.destination.alternates
  • Type: Array
  • Available since 1.43.0

The URLs that FusionAuth accepts as SAML login destinations when identityProvider.assertionConfiguration.destination.policy is AllowAlternates.

identityProvider.assertionConfiguration.destination.policy
  • Type: String
  • Available since 1.43.0

The policy for the destination assertion on the SAML login request. The possible values are:

  • Enabled: FusionAuth verifies that the Destination attribute in the SAML response equals the expected destination. The FusionAuth hosted login pages expect the FusionAuth ACS (Assertion Consumer Service) URL. The Start a SAML v2 Login Request API expects data.samlDestination. Enabled is the default and the recommended setting.
  • Disabled: FusionAuth doesn't validate the Destination attribute. FusionAuth doesn't recommend this setting.
  • AllowAlternates: FusionAuth verifies that the Destination attribute is either the FusionAuth ACS or one of the values in identityProvider.assertionConfiguration.destination.alternates. Use this setting with caution, to help migrate from a third-party IdP.
identityProvider.assertionDecryptionConfiguration.enabled
  • Type: Boolean
  • Available since 1.55.1

Whether FusionAuth requires encrypted assertions in SAML responses from the Identity Provider.

When true, FusionAuth rejects a SAML response from the IdP that contains an unencrypted assertion.

identityProvider.assertionDecryptionConfiguration.keyTransportDecryptionKeyId
  • Type: UUID
  • Available since 1.55.1

The Id of the key in Key Master that decrypts the symmetric key on SAML responses from the Identity Provider. The Key must contain an RSA private key.

identityProvider.buttonImageURL
  • Type: String

The URL of the top-level button image on the FusionAuth login page for this Identity Provider.

identityProvider.buttonText
  • Type: String

The top-level button text on the FusionAuth login page for this Identity Provider.

identityProvider.attributeMappings
  • Type: Map<String, String>
  • Available since 1.65.0

A map of attribute mappings that FusionAuth applies during user reconciliation when the Identity Provider has no reconcile Lambda.

Each key is a FusionAuth target field path. Each key begins with user. or registration.. Each value is a source expression in the payload of the IdP response.

When identityProvider.linkingStrategy is LinkAnonymously, FusionAuth ignores this field.

FusionAuth ignores a mapping that resolves to null, that FusionAuth can't extract, or that FusionAuth can't write to the target field. A mapping to user.password doesn't set a password.

identityProvider.debug
  • Type: Boolean

Whether debug is enabled for the Identity Provider. When true, FusionAuth creates an Event Log each time FusionAuth reconciles a login through the Identity Provider.

identityProvider.domains
  • Type: Array<String>

An optional list of domains that use this SAML v2 Identity Provider. A list of domains turns the FusionAuth login form into a domain-based login form, which first asks the user for an email address. FusionAuth uses the email address to decide whether to use an Identity Provider. When FusionAuth uses an IdP, FusionAuth redirects the browser to the login URL of the IdP. Otherwise, the form shows the password field, and the user logs in with FusionAuth.

identityProvider.emailClaim
  • Type: String

The name of the email claim (an attribute in the Assertion element) in the SAML response that contains the email address of the user.

identityProvider.enabled
  • Type: Boolean

Whether this Identity Provider is enabled. When false, FusionAuth disables the IdP globally.

identityProvider.id
  • Type: UUID

The Id of the Identity Provider.

identityProvider.idpEndpoint
  • Type: String

The URL of the SAML v2 login page of the Identity Provider.

identityProvider.idpInitiatedConfiguration.enabled
  • Type: Boolean
  • Available since 1.43.0

Whether FusionAuth accepts IdP-initiated login requests from this SAML v2 Identity Provider. IdP-initiated login requires a valid license.

identityProvider.idpInitiatedConfiguration.issuer
  • Type: String
  • Available since 1.43.0

The EntityId (unique identifier) of the SAML v2 Identity Provider. The IdP gives you this value.

identityProvider.insertInstant
  • Type: Long

The instant that FusionAuth added the Identity Provider to the database.

identityProvider.issuer
  • Type: String

The EntityId (unique identifier) that FusionAuth uses as the SAML service provider.

When the value isn't set, FusionAuth uses {'<base_url>/samlv2/sp/<identityProviderId>'}.

identityProvider.lastUpdateInstant
  • Type: Long

The instant that FusionAuth last updated the Identity Provider in the database.

identityProvider.keyId
  • Type: UUID
  • Deprecated

The Id of the key in Key Master that verifies the signature on SAML responses from the Identity Provider.

Deprecated since 1.69.0

In version 1.69.0 and later, use identityProvider.verificationKeyIds. For backward compatibility, FusionAuth sets identityProvider.keyId to the first entry in identityProvider.verificationKeyIds.

identityProvider.lambdaConfiguration.reconcileId
  • Type: UUID

The Id of a SAML reconcile lambda that FusionAuth runs when the Identity Provider returns a successful SAML response.

identityProvider.linkingStrategy
  • Type: String
  • Available since 1.28.0

The strategy that FusionAuth uses to link the SAML v2 Identity Provider to the User.

The possible values are:

  • CreatePendingLink: FusionAuth creates a pending link.
  • Disabled: FusionAuth doesn't link automatically. Available since 1.37.0
  • LinkAnonymously: FusionAuth links by the unique Id from the IdP, without a username or email address.
  • LinkByEmail: FusionAuth links by email address, and creates a missing User.
  • LinkByEmailForExistingUser: FusionAuth links by email address, and doesn't create a missing User.
  • LinkByUsername: FusionAuth links by username, and creates a missing User.
  • LinkByUsernameForExistingUser: FusionAuth links by username, and doesn't create a missing User.
identityProvider.loginHintConfiguration.enabled
  • Type: Boolean
  • Available since 1.43.0

When true and the AuthN request uses HTTP-Redirect bindings, FusionAuth sends the username or email address to the IdP as a login hint, when available. FusionAuth sends the hint in the parameter that identityProvider.loginHintConfiguration.parameterName names.

identityProvider.loginHintConfiguration.parameterName
  • Type: String
  • Available since 1.43.0

The name of the parameter that passes the username or email address to the IdP as a login hint. FusionAuth sends the parameter when identityProvider.loginHintConfiguration.enabled is true and the AuthN request uses HTTP-Redirect bindings.

identityProvider.name
  • Type: String

The name of this SAML v2 Identity Provider. FusionAuth uses the name for display only.

identityProvider.nameIdFormat
  • Type: String

The Name Id format that FusionAuth requests. A Service Provider (SP) and an Identity Provider (IdP) use the Name Id to refer to a user. The SP sets the preferred format in the AuthN request, and the IdP tries to use that format in the AuthN response.

identityProvider.postRequest
  • Type: Boolean
  • Available since 1.20.0

When true, FusionAuth sends the authentication request with the HTTP POST binding. Otherwise, FusionAuth uses the default Redirect binding, which uses the HTTP GET method.

identityProvider.requestSigningKeyId
  • Type: UUID
  • Available since 1.20.0

The Id of the key pair that signs the SAML request.

identityProvider.signRequest
  • Type: Boolean
  • Available since 1.20.0

When true, FusionAuth signs the authentication requests that FusionAuth sends to the IdP.

identityProvider.source
  • Type: String
  • Available since 1.65.0

The source of this Identity Provider.

identityProvider.tenantConfiguration
  • Type: Map<UUID, Object>
  • Available since 1.32.0

The configuration for each Tenant that limits the number of Links a User can have for this Identity Provider.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount
  • Type: Object
  • Available since 1.32.0

The policy for Identity Provider Links in the Tenant.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount.enabled
  • Type: Boolean
  • Defaults to false
  • Available since 1.32.0

When true, FusionAuth limits the number of Links a User can create to maximumLinks.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount.maximumLinks
  • Type: Integer
  • Defaults to 42
  • Available since 1.32.0

The maximum number of Links a User can have for this Identity Provider. The limit applies only to this IdP, so a User can have more Links across all Identity Providers. The value must be greater than 0.

identityProvider.tenantId
  • Type: UUID
  • Available since 1.62.0

The unique Id of the Tenant. The response includes the value when the Identity Provider is scoped to a Tenant. A Tenant-scoped IdP authenticates users only in the context of the Tenant. You can't change the value after you create the Identity Provider.

identityProvider.type
  • Type: String

The type of the Identity Provider. The value is SAMLv2.

identityProvider.uniqueIdClaim
  • Type: String

The name of the attribute in the SAML response that contains the unique Id of the user. FusionAuth uses the unique Id to link the user to this Identity Provider. When the value isn't set, FusionAuth uses the NameID value.

identityProvider.useNameIdForEmail
  • Type: Boolean

Whether FusionAuth uses the value of the NameID element as the email address of the user during reconciliation.

identityProvider.usernameClaim
  • Type: String

The name of the attribute in the SAML response that contains the username of the user. FusionAuth never uses the NameID as the username. When the value isn't set, the user has no username unless the reconcile lambda of the IdP sets one. When identityProvider.linkingStrategy is LinkByUsername or LinkByUsernameForExistingUser, set the value, because those strategies link users by username.

identityProvider.verificationKeyIds
  • Type: Array<UUID>
  • Available since 1.69.0

The Ids of the keys in Key Master that verify the signature on SAML responses from the Identity Provider. The first key verifies responses whose signature doesn't include a certificate. For more information, see SAML v2 Signature Verification.

In versions before 1.69.0, the response contains identityProvider.keyId instead.

identityProvider.xmlSignatureC14nMethod
  • Type: String
  • Available since 1.20.0

The XML signature canonicalization method that FusionAuth uses to digest and sign the SAML request.

The possible values are:

  • exclusive: The URI for this method is http://www.w3.org/2001/10/xml-exc-c14n#
  • exclusive_with_comments: The URI for this method is http://www.w3.org/2001/10/xml-exc-c14n#WithComments
  • inclusive: The URI for this method is http://www.w3.org/TR/2001/REC-xml-c14n-20010315
  • inclusive_with_comments: The URI for this method is http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments
Example SAML v2 Response JSON
{
  "identityProvider": {
    "applicationConfiguration": {
      "2c73b816-f48c-4c36-964b-40589a9ae629": {
        "buttonText": "Login with SAML (app text)",
        "createRegistration": true,
        "enabled": true
      }
    },
    "assertionConfiguration": {
      "destination": {
        "alternates": [],
        "policy": "Enabled"
      }
    },
    "assertionDecryptionConfiguration": {
      "enabled": true,
      "keyTransportDecryptionKeyId": "ce0ca33d-3555-4b89-9777-0ef1276f7b26"
    },
    "buttonText": "Login with SAML",
    "emailClaim": "email",
    "debug": false,
    "domains": [],
    "enabled": true,
    "id": "e13afb7b-77c7-4451-9c07-897d38f4fb3d",
    "idpEndpoint": "https://www.example.com/login",
    "idpInitiatedConfiguration": {
      "enabled": false,
      "issuer": "https://www.example.com"
    },
    "insertInstant": 1595361142909,
    "lastUpdateInstant": 1595361143101,
    "keyId": "a60f46c9-5d8e-48af-ac23-dbaa00579c57",
    "lambdaConfiguration": {
      "reconcileId": "0bf07e2d-08fa-4d56-8f63-9f9d40ee7fd5"
    },
    "linkingStrategy": "LinkByEmail",
    "loginHintConfiguration": {
      "enabled": true,
      "parameterName": "login_hint"
    },
    "name": "My SAML provider",
    "nameIdFormat": "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent",
    "postRequest": true,
    "requestSigningKeyId": "3168129b-91fa-46f4-9676-947f5509fdce",
    "signRequest": true,
    "tenantConfiguration": {
      "e872a880-b14f-6d62-c312-cb40f22af465": {
        "limitUserLinkCount": {
          "enabled": false,
          "maximumLinks": 42
        }
      }
    },
    "type": "SAMLv2",
    "xmlSignatureC14nMethod": "exclusive",
    "uniqueIdClaim": "userId",
    "useNameIdForEmail": true,
    "usernameClaim": "username",
    "verificationKeyIds": [
      "a60f46c9-5d8e-48af-ac23-dbaa00579c57",
      "6a3a08d9-137e-40fc-83ad-6e50afcfdae4"
    ]
  }
}

Update a SAML v2 Identity Provider#

This API is used to update an existing SAML v2 Identity Provider.

You must specify all of the properties of the SAML v2 Identity Provider when calling this API with the PUT HTTP method. When used with PUT, this API doesn't merge the existing SAML v2 Identity Provider and your new data. It replaces the existing SAML v2 Identity Provider with your new data.

Utilize the PATCH HTTP method to send specific changes to merge into an existing SAML v2 Identity Provider.

Request#

Send the full SAML v2 Identity Provider with your changes applied.

API Key Authentication
Update an Identity Provider
PUT/api/identity-provider/{identityProviderId}
OpenAPI Spec
PATCH/api/identity-provider/{identityProviderId}
OpenAPI Spec
Note

For backward compatibility, a PATCH request with a Content-Type of application/json accepts the same body as the PUT request. FusionAuth merges the request into the existing object:

  • FusionAuth keeps every field that the request leaves out, so send only the fields you want to change.
  • FusionAuth merges a map, such as data, by key. To remove a key, set the key to null.
  • FusionAuth appends the values in a request array to the existing array, unless this API documents otherwise. An empty array leaves the existing array unchanged, so you can't remove values from an appending array.
  • FusionAuth adds each object in an array of objects as a new element. FusionAuth doesn't match the object to an existing element by Id or by position.
  • Don't send a value that an array of Ids already contains, such as a key Id or a Tenant Id. Some of these arrays then return a 500 status code.
  • Don't set an array to null. Depending on the field, FusionAuth clears the array or returns a 500 status code.

To remove values from an array, PUT the full object, or set the Content-Type to one of the following media types:

For more information, see The PATCH HTTP Method.

Path Parameters#

identityProviderId
  • Type: UUID
  • Required
  • Immutable

The unique Id of the SAML v2 Identity Provider to update.

Request Body#
identityProvider.applicationConfiguration
  • Type: Map<UUID, Object>
  • Optional

The configuration for each Application that the Identity Provider is enabled for.

Available since 1.70.0 To enable this Identity Provider for CIMD clients, use the Id of a CIMD domain as the key. FusionAuth then enables the IdP for every client that registers through that domain.

identityProvider.applicationConfiguration[applicationId].buttonImageURL
  • Type: String
  • Optional

An optional Application-specific override for the top-level buttonImageURL.

identityProvider.applicationConfiguration[applicationId].buttonText
  • Type: String
  • Optional

An optional Application-specific override for the top-level buttonText.

identityProvider.applicationConfiguration[applicationId].createRegistration
  • Type: Boolean
  • Optional
  • Defaults to true

Whether FusionAuth registers the User for the Application automatically. When true and a User with no Registration for the Application logs in through the Identity Provider, FusionAuth creates the Registration.

For a CIMD domain Id, this value is always false, because FusionAuth doesn't register Users for CIMD clients. Available since 1.70.0

identityProvider.applicationConfiguration[applicationId].enabled
  • Type: Boolean
  • Optional
  • Defaults to false

Whether this Identity Provider is enabled for the Application that the applicationId key specifies.

Available since 1.70.0 When identityProvider.idpInitiatedConfiguration.enabled is true, this value must be false for a CIMD domain Id. IdP-initiated login doesn't support CIMD clients.

identityProvider.assertionConfiguration.destination.alternates
  • Type: Array
  • Optional
  • Available since 1.43.0

The URLs that FusionAuth accepts as SAML login destinations when identityProvider.assertionConfiguration.destination.policy is AllowAlternates.

identityProvider.assertionConfiguration.destination.policy
  • Type: String
  • Optional
  • Defaults to Enabled
  • Available since 1.43.0

The policy for the destination assertion on the SAML login request. The possible values are:

  • Enabled: FusionAuth verifies that the Destination attribute in the SAML response equals the expected destination. The FusionAuth hosted login pages expect the FusionAuth ACS (Assertion Consumer Service) URL. The Start a SAML v2 Login Request API expects data.samlDestination. Enabled is the default and the recommended setting.
  • Disabled: FusionAuth doesn't validate the Destination attribute. FusionAuth doesn't recommend this setting.
  • AllowAlternates: FusionAuth verifies that the Destination attribute is either the FusionAuth ACS or one of the values in identityProvider.assertionConfiguration.destination.alternates. Use this setting with caution, to help migrate from a third-party IdP.
identityProvider.assertionDecryptionConfiguration.enabled
  • Type: Boolean
  • Optional
  • Defaults to false
  • Available since 1.55.1

Whether FusionAuth requires encrypted assertions in SAML responses from the Identity Provider.

When true, FusionAuth rejects a SAML response from the IdP that contains an unencrypted assertion.

identityProvider.assertionDecryptionConfiguration.keyTransportDecryptionKeyId
  • Type: UUID
  • Optional
  • Available since 1.55.1

The Id of the key in Key Master that decrypts the symmetric key on SAML responses from the Identity Provider. The Key must contain an RSA private key.

This field is required when identityProvider.assertionDecryptionConfiguration.enabled is true.

identityProvider.buttonImageURL
  • Type: String
  • Optional

The URL of the top-level button image on the FusionAuth login page for this Identity Provider.

identityProvider.buttonText
  • Type: String
  • Optional
  • Defaults to Login with SAML

The top-level button text on the FusionAuth login page for this Identity Provider.

identityProvider.attributeMappings
  • Type: Map<String, String>
  • Optional
  • Available since 1.65.0

A map of attribute mappings that FusionAuth applies during user reconciliation when the Identity Provider has no reconcile Lambda. The default is an empty map.

Each key is a FusionAuth target field path. Each key must begin with user. or registration.. FusionAuth ignores a key with any other prefix. Each value is a source expression in the payload of the IdP response. FusionAuth converts a dot-notated value, such as email or id_token.given_name, to a JSON Pointer. FusionAuth uses a value that starts with / as a JSON Pointer without changes.

You can't use this field with identityProvider.lambdaConfiguration.reconcileId.

When identityProvider.linkingStrategy is LinkAnonymously, FusionAuth ignores this field.

FusionAuth ignores a mapping that resolves to null, that FusionAuth can't extract, or that FusionAuth can't write to the target field. A mapping to user.password doesn't set a password.

identityProvider.debug
  • Type: Boolean
  • Optional
  • Defaults to false
  • Available since 1.7.3

Whether debug is enabled for the Identity Provider. When true, FusionAuth creates an Event Log each time FusionAuth reconciles a login through the Identity Provider.

Turn on debug while you build an integration or troubleshoot an issue with this IdP. Turn off debug in production.

identityProvider.domains
  • Type: Array<String>
  • Optional

An optional list of domains that use this SAML v2 Identity Provider. A list of domains turns the FusionAuth login form into a domain-based login form, which first asks the user for an email address. FusionAuth uses the email address to decide whether to use an Identity Provider. When FusionAuth uses an IdP, FusionAuth redirects the browser to the login URL of the IdP. Otherwise, the form shows the password field, and the user logs in with FusionAuth.

identityProvider.emailClaim
  • Type: String
  • Optional

The name of the email claim (an attribute in the Assertion element) in the SAML response that contains the email address of the user.

When identityProvider.useNameIdForEmail is false, set this field. Otherwise, FusionAuth gets no email address from the SAML response.

identityProvider.enabled
  • Type: Boolean
  • Optional
  • Defaults to false

Whether this Identity Provider is enabled. When false, FusionAuth disables the IdP globally.

identityProvider.idpEndpoint
  • Type: String
  • Required

The URL of the SAML v2 login page of the Identity Provider. The value must be a valid URL.

identityProvider.idpInitiatedConfiguration.enabled
  • Type: Boolean
  • Optional
  • Defaults to false
  • Available since 1.43.0

Whether FusionAuth accepts IdP-initiated login requests from this SAML v2 Identity Provider. IdP-initiated login requires a valid license.

FusionAuth doesn't recommend this type of login, because an unsolicited authentication response from a third-party Identity Provider (IdP) carries risk.

In an SP-initiated login, FusionAuth is the service provider (SP), and receives the SAML Authentication Response in reply to an authentication request. FusionAuth can then validate certain parameters, and accept only a response to a request that FusionAuth started. In an IdP-initiated login, the third-party IdP sends FusionAuth a SAML Authentication Response without any request or context. FusionAuth didn't start the login, so FusionAuth can verify less, and must allow a cross-site request from the third party.

When you need this type of login for a legacy integration, or when the user experience matters most, you can enable the feature.

identityProvider.idpInitiatedConfiguration.issuer
  • Type: String
  • Optional
  • Available since 1.43.0

The EntityId (unique identifier) of the SAML v2 Identity Provider. The IdP gives you this value.

This field is required when identityProvider.idpInitiatedConfiguration.enabled is true.

identityProvider.issuer
  • Type: String
  • Optional

The EntityId (unique identifier) that FusionAuth uses as the SAML service provider.

When you leave out the value, FusionAuth uses the default service provider EntityId, {'<base_url>/samlv2/sp/<identityProviderId>'}.

When you provide the value, the value can't be an empty string.

identityProvider.keyId
  • Type: UUID
  • Optional
  • Deprecated

The Id of the key in Key Master that verifies the signature on SAML responses from the Identity Provider.

Deprecated since 1.69.0

In version 1.69.0 and later, use identityProvider.verificationKeyIds. For backward compatibility, FusionAuth sets identityProvider.keyId to the first entry in identityProvider.verificationKeyIds in responses. When a request sets identityProvider.keyId and leaves out identityProvider.verificationKeyIds, FusionAuth adds identityProvider.keyId to identityProvider.verificationKeyIds.

identityProvider.lambdaConfiguration.reconcileId
  • Type: UUID
  • Optional

The Id of a SAML reconcile lambda that FusionAuth runs when the Identity Provider returns a successful SAML response.

The Lambda must be of type SAMLv2Reconcile.

identityProvider.linkingStrategy
  • Type: String
  • Optional
  • Defaults to LinkByEmail
  • Available since 1.28.0

The strategy that FusionAuth uses to link the SAML v2 Identity Provider to the User.

Available since 1.65.0 You can only change this value when the identity provider is disabled. To change the linking strategy for an identity provider that is already enabled, disable the provider, change the value, and then re-enable the provider.

The possible values are:

  • CreatePendingLink: FusionAuth doesn't link automatically. FusionAuth returns a pending link Id. Use the pending link Id to link to an existing User.
  • Disabled: FusionAuth doesn't link automatically. You must create Links with the API. Available since 1.37.0
  • LinkAnonymously: FusionAuth always creates a Link based on the unique Id that the IdP returns. FusionAuth doesn't require a username or email address, and doesn't use a username or email address to link the User. FusionAuth doesn't run a reconcile Lambda.
  • LinkByEmail: FusionAuth links to an existing User by email address. When no User has the email address that the IdP returns, FusionAuth creates a User with that email address.
  • LinkByEmailForExistingUser: FusionAuth links only to an existing User by email address. When no User has the email address that the IdP returns, FusionAuth doesn't create a User.
  • LinkByUsername: FusionAuth links to an existing User by username. When no User has the username that the IdP returns, FusionAuth creates a User with that username.
  • LinkByUsernameForExistingUser: FusionAuth links only to an existing User by username. When no User has the username that the IdP returns, FusionAuth doesn't create a User.
identityProvider.loginHintConfiguration.enabled
  • Type: Boolean
  • Optional
  • Defaults to true
  • Available since 1.43.0

When true and the AuthN request uses HTTP-Redirect bindings, FusionAuth sends the username or email address to the IdP as a login hint, when available. FusionAuth sends the hint in the parameter that identityProvider.loginHintConfiguration.parameterName names.

identityProvider.loginHintConfiguration.parameterName
  • Type: String
  • Optional
  • Defaults to login_hint
  • Available since 1.43.0

The name of the parameter that passes the username or email address to the IdP as a login hint. FusionAuth sends the parameter when identityProvider.loginHintConfiguration.enabled is true and the AuthN request uses HTTP-Redirect bindings.

This field is required when identityProvider.loginHintConfiguration.enabled is true.

identityProvider.name
  • Type: String
  • Required

The name of this SAML v2 Identity Provider. FusionAuth uses the name for display only. The name must be unique across all Identity Providers.

identityProvider.nameIdFormat
  • Type: String
  • Optional
  • Defaults to urn:oasis:names:tc:SAML:2.0:nameid-format:persistent

The Name Id format to request. A Service Provider (SP) and an Identity Provider (IdP) use the Name Id to refer to a user. The SP sets the preferred format in the AuthN request, and the IdP tries to use that format in the AuthN response.

identityProvider.postRequest
  • Type: Boolean
  • Optional
  • Available since 1.20.0

When true, FusionAuth sends the authentication request with the HTTP POST binding. Otherwise, FusionAuth uses the default Redirect binding, which uses the HTTP GET method.

identityProvider.requestSigningKeyId
  • Type: UUID
  • Optional
  • Available since 1.20.0

The Id of the key pair that signs the SAML request.

This field is required when identityProvider.signRequest is true.

identityProvider.signRequest
  • Type: Boolean
  • Optional
  • Available since 1.20.0

When true, FusionAuth signs the authentication requests that FusionAuth sends to the IdP.

identityProvider.source
  • Type: String
  • Optional
  • Defaults to System
  • Available since 1.65.0

The source of this Identity Provider.

The maximum length is 191 characters.

FusionAuth sets the source only on create. On update, FusionAuth ignores the value and keeps the existing source.

identityProvider.tenantConfiguration
  • Type: Map<UUID, Object>
  • Available since 1.32.0

The configuration for each Tenant that limits the number of Links a User can have for this Identity Provider.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount
  • Type: Object
  • Available since 1.32.0

The policy for Identity Provider Links in the Tenant.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount.enabled
  • Type: Boolean
  • Defaults to false
  • Available since 1.32.0

When true, FusionAuth limits the number of Links a User can create to maximumLinks.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount.maximumLinks
  • Type: Integer
  • Defaults to 42
  • Available since 1.32.0

The maximum number of Links a User can have for this Identity Provider. The limit applies only to this IdP, so a User can have more Links across all Identity Providers. The value must be greater than 0.

identityProvider.tenantId
  • Type: UUID
  • Optional
  • Available since 1.62.0

The unique Id of the Tenant.

When you provide a value, FusionAuth creates an Identity Provider scoped to the Tenant. Otherwise, FusionAuth creates a global IdP. A Tenant-scoped IdP authenticates users only in the context of the Tenant. A global IdP works with any Tenant.

You can't change the value after you create the Identity Provider.

identityProvider.type
  • Type: String
  • Required

The type of the Identity Provider. Set the value to SAMLv2.

identityProvider.uniqueIdClaim
  • Type: String
  • Optional

The name of the attribute in the SAML response that contains the unique Id of the user. FusionAuth uses the unique Id to link the user to this Identity Provider. When you leave out the value, FusionAuth uses the NameID value.

identityProvider.useNameIdForEmail
  • Type: Boolean
  • Optional
  • Defaults to false

Whether FusionAuth uses the value of the NameID element as the email address of the user during reconciliation. When false, set identityProvider.emailClaim.

identityProvider.usernameClaim
  • Type: String
  • Optional

The name of the attribute in the SAML response that contains the username of the user. FusionAuth never uses the NameID as the username. When you leave out the value, the user has no username unless the reconcile lambda of the IdP sets one. When identityProvider.linkingStrategy is LinkByUsername or LinkByUsernameForExistingUser, set the value, because those strategies link users by username.

identityProvider.verificationKeyIds
  • Type: Array<UUID>
  • Optional
  • Available since 1.69.0

The Ids of the keys in Key Master that verify the signature on SAML responses from the Identity Provider. FusionAuth trusts only these keys.

When the signature includes an X.509 certificate, FusionAuth uses the key whose certificate has the same SHA-1 thumbprint, wherever the key appears in the list. When the signature doesn't include a certificate, FusionAuth uses the first key in the list. A key without a certificate can verify a response only as the first key. For more information, see SAML v2 Signature Verification.

This field is required when you don't set the deprecated identityProvider.keyId.

Versions before 1.69.0 don't have this field. Use identityProvider.keyId instead.

identityProvider.xmlSignatureC14nMethod
  • Type: String
  • Optional
  • Available since 1.20.0

The XML signature canonicalization method that FusionAuth uses to digest and sign the SAML request.

This field is required when identityProvider.signRequest and identityProvider.postRequest are true.

The possible values are:

  • exclusive: The URI for this method is http://www.w3.org/2001/10/xml-exc-c14n#
  • exclusive_with_comments: The URI for this method is http://www.w3.org/2001/10/xml-exc-c14n#WithComments
  • inclusive: The URI for this method is http://www.w3.org/TR/2001/REC-xml-c14n-20010315
  • inclusive_with_comments: The URI for this method is http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments
Example SAML v2 Request JSON
{
  "identityProvider": {
    "applicationConfiguration": {
      "2c73b816-f48c-4c36-964b-40589a9ae629": {
        "buttonText": "Login with SAML (app text)",
        "createRegistration": true,
        "enabled": true
      }
    },
    "assertionConfiguration": {
      "destination": {
        "alternates": [],
        "policy": "Enabled"
      }
    },
    "assertionDecryptionConfiguration": {
      "enabled": true,
      "keyTransportDecryptionKeyId": "ce0ca33d-3555-4b89-9777-0ef1276f7b26"
    },
    "buttonText": "Login with SAML",
    "debug": false,
    "emailClaim": "email",
    "enabled": true,
    "idpEndpoint": "https://www.example.com/login",
    "idpInitiatedConfiguration": {
      "enabled": false,
      "issuer": "https://www.example.com"
    },
    "lambdaConfiguration": {
      "reconcileId": "0bf07e2d-08fa-4d56-8f63-9f9d40ee7fd5"
    },
    "linkingStrategy": "LinkByEmail",
    "loginHintConfiguration": {
      "enabled": true,
      "parameterName": "login_hint"
    },
    "name": "My SAML provider",
    "nameIdFormat": "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent",
    "postRequest": true,
    "requestSigningKeyId": "3168129b-91fa-46f4-9676-947f5509fdce",
    "signRequest": true,
    "tenantConfiguration": {
      "e872a880-b14f-6d62-c312-cb40f22af465": {
        "limitUserLinkCount": {
          "enabled": false,
          "maximumLinks": 42
        }
      }
    },
    "type": "SAMLv2",
    "verificationKeyIds": [
      "a60f46c9-5d8e-48af-ac23-dbaa00579c57",
      "6a3a08d9-137e-40fc-83ad-6e50afcfdae4"
    ],
    "xmlSignatureC14nMethod": "exclusive",
    "uniqueIdClaim": "userId",
    "useNameIdForEmail": true,
    "usernameClaim": "username"
  }
}
Example SAML v2 Request JSON (with issuer override)
{
  "identityProvider": {
    "applicationConfiguration": {
      "2c73b816-f48c-4c36-964b-40589a9ae629": {
        "buttonText": "Login with SAML",
        "createRegistration": true,
        "enabled": true
      }
    },
    "assertionConfiguration": {
      "destination": {
        "alternates": [],
        "policy": "Enabled"
      }
    },
    "assertionDecryptionConfiguration": {
      "enabled": true,
      "keyTransportDecryptionKeyId": "ce0ca33d-3555-4b89-9777-0ef1276f7b26"
    },
    "buttonText": "Login with SAML",
    "debug": false,
    "emailClaim": "email",
    "enabled": true,
    "idpEndpoint": "https://www.example.com/login",
    "idpInitiatedConfiguration": {
      "enabled": false,
      "issuer": "https://www.example.com"
    },
    "issuer": "https://sp.piedpiper.example.com/saml",
    "keyId": "a60f46c9-5d8e-48af-ac23-dbaa00579c57",
    "lambdaConfiguration": {
      "reconcileId": "0bf07e2d-08fa-4d56-8f63-9f9d40ee7fd5"
    },
    "linkingStrategy": "LinkByEmail",
    "loginHintConfiguration": {
      "enabled": true,
      "parameterName": "login_hint"
    },
    "name": "My SAML provider",
    "nameIdFormat": "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent",
    "postRequest": true,
    "requestSigningKeyId": "3168129b-91fa-46f4-9676-947f5509fdce",
    "signRequest": true,
    "tenantConfiguration": {
      "e872a880-b14f-6d62-c312-cb40f22af465": {
        "limitUserLinkCount": {
          "enabled": false,
          "maximumLinks": 42
        }
      }
    },
    "type": "SAMLv2",
    "xmlSignatureC14nMethod": "exclusive",
    "uniqueIdClaim": "userId",
    "useNameIdForEmail": true,
    "usernameClaim": "username"
  }
}

Response#

The response contains the updated SAML v2 Identity Provider.

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
404The object you're updating doesn't exist. The response is empty.
409FusionAuth found a conflict while processing the request. When the response has a general error code of [retryableConflict], retry the request with exponential backoff.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response usually contains an Errors JSON object with the [Exception] general error code. On MySQL, a data field larger than the database column also returns 500. For more information, see Data Field Sizes.

Response Body#

identityProvider.applicationConfiguration
  • Type: Map<UUID, Object>

The configuration for each Application that the Identity Provider is enabled for.

Available since 1.70.0 To enable this Identity Provider for CIMD clients, use the Id of a CIMD domain as the key. FusionAuth then enables the IdP for every client that registers through that domain.

identityProvider.applicationConfiguration[applicationId].buttonImageURL
  • Type: String

An optional Application-specific override for the top-level buttonImageURL.

identityProvider.applicationConfiguration[applicationId].buttonText
  • Type: String

An optional Application-specific override for the top-level buttonText.

identityProvider.applicationConfiguration[applicationId].createRegistration
  • Type: Boolean

Whether FusionAuth registers the User for the Application automatically. When true and a User with no Registration for the Application logs in through the Identity Provider, FusionAuth creates the Registration.

For a CIMD domain Id, this value is always false, because FusionAuth doesn't register Users for CIMD clients. Available since 1.70.0

identityProvider.applicationConfiguration[applicationId].enabled
  • Type: Boolean

Whether this Identity Provider is enabled for the Application that the applicationId key specifies.

identityProvider.assertionConfiguration.destination.alternates
  • Type: Array
  • Available since 1.43.0

The URLs that FusionAuth accepts as SAML login destinations when identityProvider.assertionConfiguration.destination.policy is AllowAlternates.

identityProvider.assertionConfiguration.destination.policy
  • Type: String
  • Available since 1.43.0

The policy for the destination assertion on the SAML login request. The possible values are:

  • Enabled: FusionAuth verifies that the Destination attribute in the SAML response equals the expected destination. The FusionAuth hosted login pages expect the FusionAuth ACS (Assertion Consumer Service) URL. The Start a SAML v2 Login Request API expects data.samlDestination. Enabled is the default and the recommended setting.
  • Disabled: FusionAuth doesn't validate the Destination attribute. FusionAuth doesn't recommend this setting.
  • AllowAlternates: FusionAuth verifies that the Destination attribute is either the FusionAuth ACS or one of the values in identityProvider.assertionConfiguration.destination.alternates. Use this setting with caution, to help migrate from a third-party IdP.
identityProvider.assertionDecryptionConfiguration.enabled
  • Type: Boolean
  • Available since 1.55.1

Whether FusionAuth requires encrypted assertions in SAML responses from the Identity Provider.

When true, FusionAuth rejects a SAML response from the IdP that contains an unencrypted assertion.

identityProvider.assertionDecryptionConfiguration.keyTransportDecryptionKeyId
  • Type: UUID
  • Available since 1.55.1

The Id of the key in Key Master that decrypts the symmetric key on SAML responses from the Identity Provider. The Key must contain an RSA private key.

identityProvider.buttonImageURL
  • Type: String

The URL of the top-level button image on the FusionAuth login page for this Identity Provider.

identityProvider.buttonText
  • Type: String

The top-level button text on the FusionAuth login page for this Identity Provider.

identityProvider.attributeMappings
  • Type: Map<String, String>
  • Available since 1.65.0

A map of attribute mappings that FusionAuth applies during user reconciliation when the Identity Provider has no reconcile Lambda.

Each key is a FusionAuth target field path. Each key begins with user. or registration.. Each value is a source expression in the payload of the IdP response.

When identityProvider.linkingStrategy is LinkAnonymously, FusionAuth ignores this field.

FusionAuth ignores a mapping that resolves to null, that FusionAuth can't extract, or that FusionAuth can't write to the target field. A mapping to user.password doesn't set a password.

identityProvider.debug
  • Type: Boolean

Whether debug is enabled for the Identity Provider. When true, FusionAuth creates an Event Log each time FusionAuth reconciles a login through the Identity Provider.

identityProvider.domains
  • Type: Array<String>

An optional list of domains that use this SAML v2 Identity Provider. A list of domains turns the FusionAuth login form into a domain-based login form, which first asks the user for an email address. FusionAuth uses the email address to decide whether to use an Identity Provider. When FusionAuth uses an IdP, FusionAuth redirects the browser to the login URL of the IdP. Otherwise, the form shows the password field, and the user logs in with FusionAuth.

identityProvider.emailClaim
  • Type: String

The name of the email claim (an attribute in the Assertion element) in the SAML response that contains the email address of the user.

identityProvider.enabled
  • Type: Boolean

Whether this Identity Provider is enabled. When false, FusionAuth disables the IdP globally.

identityProvider.id
  • Type: UUID

The Id of the Identity Provider.

identityProvider.idpEndpoint
  • Type: String

The URL of the SAML v2 login page of the Identity Provider.

identityProvider.idpInitiatedConfiguration.enabled
  • Type: Boolean
  • Available since 1.43.0

Whether FusionAuth accepts IdP-initiated login requests from this SAML v2 Identity Provider. IdP-initiated login requires a valid license.

identityProvider.idpInitiatedConfiguration.issuer
  • Type: String
  • Available since 1.43.0

The EntityId (unique identifier) of the SAML v2 Identity Provider. The IdP gives you this value.

identityProvider.insertInstant
  • Type: Long

The instant that FusionAuth added the Identity Provider to the database.

identityProvider.issuer
  • Type: String

The EntityId (unique identifier) that FusionAuth uses as the SAML service provider.

When the value isn't set, FusionAuth uses {'<base_url>/samlv2/sp/<identityProviderId>'}.

identityProvider.lastUpdateInstant
  • Type: Long

The instant that FusionAuth last updated the Identity Provider in the database.

identityProvider.keyId
  • Type: UUID
  • Deprecated

The Id of the key in Key Master that verifies the signature on SAML responses from the Identity Provider.

Deprecated since 1.69.0

In version 1.69.0 and later, use identityProvider.verificationKeyIds. For backward compatibility, FusionAuth sets identityProvider.keyId to the first entry in identityProvider.verificationKeyIds.

identityProvider.lambdaConfiguration.reconcileId
  • Type: UUID

The Id of a SAML reconcile lambda that FusionAuth runs when the Identity Provider returns a successful SAML response.

identityProvider.linkingStrategy
  • Type: String
  • Available since 1.28.0

The strategy that FusionAuth uses to link the SAML v2 Identity Provider to the User.

The possible values are:

  • CreatePendingLink: FusionAuth creates a pending link.
  • Disabled: FusionAuth doesn't link automatically. Available since 1.37.0
  • LinkAnonymously: FusionAuth links by the unique Id from the IdP, without a username or email address.
  • LinkByEmail: FusionAuth links by email address, and creates a missing User.
  • LinkByEmailForExistingUser: FusionAuth links by email address, and doesn't create a missing User.
  • LinkByUsername: FusionAuth links by username, and creates a missing User.
  • LinkByUsernameForExistingUser: FusionAuth links by username, and doesn't create a missing User.
identityProvider.loginHintConfiguration.enabled
  • Type: Boolean
  • Available since 1.43.0

When true and the AuthN request uses HTTP-Redirect bindings, FusionAuth sends the username or email address to the IdP as a login hint, when available. FusionAuth sends the hint in the parameter that identityProvider.loginHintConfiguration.parameterName names.

identityProvider.loginHintConfiguration.parameterName
  • Type: String
  • Available since 1.43.0

The name of the parameter that passes the username or email address to the IdP as a login hint. FusionAuth sends the parameter when identityProvider.loginHintConfiguration.enabled is true and the AuthN request uses HTTP-Redirect bindings.

identityProvider.name
  • Type: String

The name of this SAML v2 Identity Provider. FusionAuth uses the name for display only.

identityProvider.nameIdFormat
  • Type: String

The Name Id format that FusionAuth requests. A Service Provider (SP) and an Identity Provider (IdP) use the Name Id to refer to a user. The SP sets the preferred format in the AuthN request, and the IdP tries to use that format in the AuthN response.

identityProvider.postRequest
  • Type: Boolean
  • Available since 1.20.0

When true, FusionAuth sends the authentication request with the HTTP POST binding. Otherwise, FusionAuth uses the default Redirect binding, which uses the HTTP GET method.

identityProvider.requestSigningKeyId
  • Type: UUID
  • Available since 1.20.0

The Id of the key pair that signs the SAML request.

identityProvider.signRequest
  • Type: Boolean
  • Available since 1.20.0

When true, FusionAuth signs the authentication requests that FusionAuth sends to the IdP.

identityProvider.source
  • Type: String
  • Available since 1.65.0

The source of this Identity Provider.

identityProvider.tenantConfiguration
  • Type: Map<UUID, Object>
  • Available since 1.32.0

The configuration for each Tenant that limits the number of Links a User can have for this Identity Provider.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount
  • Type: Object
  • Available since 1.32.0

The policy for Identity Provider Links in the Tenant.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount.enabled
  • Type: Boolean
  • Defaults to false
  • Available since 1.32.0

When true, FusionAuth limits the number of Links a User can create to maximumLinks.

identityProvider.tenantConfiguration[tenantId].limitUserLinkCount.maximumLinks
  • Type: Integer
  • Defaults to 42
  • Available since 1.32.0

The maximum number of Links a User can have for this Identity Provider. The limit applies only to this IdP, so a User can have more Links across all Identity Providers. The value must be greater than 0.

identityProvider.tenantId
  • Type: UUID
  • Available since 1.62.0

The unique Id of the Tenant. The response includes the value when the Identity Provider is scoped to a Tenant. A Tenant-scoped IdP authenticates users only in the context of the Tenant. You can't change the value after you create the Identity Provider.

identityProvider.type
  • Type: String

The type of the Identity Provider. The value is SAMLv2.

identityProvider.uniqueIdClaim
  • Type: String

The name of the attribute in the SAML response that contains the unique Id of the user. FusionAuth uses the unique Id to link the user to this Identity Provider. When the value isn't set, FusionAuth uses the NameID value.

identityProvider.useNameIdForEmail
  • Type: Boolean

Whether FusionAuth uses the value of the NameID element as the email address of the user during reconciliation.

identityProvider.usernameClaim
  • Type: String

The name of the attribute in the SAML response that contains the username of the user. FusionAuth never uses the NameID as the username. When the value isn't set, the user has no username unless the reconcile lambda of the IdP sets one. When identityProvider.linkingStrategy is LinkByUsername or LinkByUsernameForExistingUser, set the value, because those strategies link users by username.

identityProvider.verificationKeyIds
  • Type: Array<UUID>
  • Available since 1.69.0

The Ids of the keys in Key Master that verify the signature on SAML responses from the Identity Provider. The first key verifies responses whose signature doesn't include a certificate. For more information, see SAML v2 Signature Verification.

In versions before 1.69.0, the response contains identityProvider.keyId instead.

identityProvider.xmlSignatureC14nMethod
  • Type: String
  • Available since 1.20.0

The XML signature canonicalization method that FusionAuth uses to digest and sign the SAML request.

The possible values are:

  • exclusive: The URI for this method is http://www.w3.org/2001/10/xml-exc-c14n#
  • exclusive_with_comments: The URI for this method is http://www.w3.org/2001/10/xml-exc-c14n#WithComments
  • inclusive: The URI for this method is http://www.w3.org/TR/2001/REC-xml-c14n-20010315
  • inclusive_with_comments: The URI for this method is http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments
Example SAML v2 Response JSON
{
  "identityProvider": {
    "applicationConfiguration": {
      "2c73b816-f48c-4c36-964b-40589a9ae629": {
        "buttonText": "Login with SAML (app text)",
        "createRegistration": true,
        "enabled": true
      }
    },
    "assertionConfiguration": {
      "destination": {
        "alternates": [],
        "policy": "Enabled"
      }
    },
    "assertionDecryptionConfiguration": {
      "enabled": true,
      "keyTransportDecryptionKeyId": "ce0ca33d-3555-4b89-9777-0ef1276f7b26"
    },
    "buttonText": "Login with SAML",
    "emailClaim": "email",
    "debug": false,
    "domains": [],
    "enabled": true,
    "id": "e13afb7b-77c7-4451-9c07-897d38f4fb3d",
    "idpEndpoint": "https://www.example.com/login",
    "idpInitiatedConfiguration": {
      "enabled": false,
      "issuer": "https://www.example.com"
    },
    "insertInstant": 1595361142909,
    "lastUpdateInstant": 1595361143101,
    "keyId": "a60f46c9-5d8e-48af-ac23-dbaa00579c57",
    "lambdaConfiguration": {
      "reconcileId": "0bf07e2d-08fa-4d56-8f63-9f9d40ee7fd5"
    },
    "linkingStrategy": "LinkByEmail",
    "loginHintConfiguration": {
      "enabled": true,
      "parameterName": "login_hint"
    },
    "name": "My SAML provider",
    "nameIdFormat": "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent",
    "postRequest": true,
    "requestSigningKeyId": "3168129b-91fa-46f4-9676-947f5509fdce",
    "signRequest": true,
    "tenantConfiguration": {
      "e872a880-b14f-6d62-c312-cb40f22af465": {
        "limitUserLinkCount": {
          "enabled": false,
          "maximumLinks": 42
        }
      }
    },
    "type": "SAMLv2",
    "xmlSignatureC14nMethod": "exclusive",
    "uniqueIdClaim": "userId",
    "useNameIdForEmail": true,
    "usernameClaim": "username",
    "verificationKeyIds": [
      "a60f46c9-5d8e-48af-ac23-dbaa00579c57",
      "6a3a08d9-137e-40fc-83ad-6e50afcfdae4"
    ]
  }
}

Delete a SAML v2 Identity Provider#

Request#

Delete the SAML v2 Identity Provider by its Id.

API Key Authentication
Delete a SAML v2 Identity Provider by Id
DELETE/api/identity-provider/{identityProviderId}
OpenAPI Spec

Path Parameters#

identityProviderId
  • Type: UUID
  • Required

The unique Id of the SAML v2 Identity Provider to delete.

Response#

The response has no JSON body.

Response Codes
CodeDescription
200The request succeeded.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
404The object you requested doesn't exist. The response is empty.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty.

Start a SAML v2 Login Request#

Available since 1.19.0

Use this API to start a SAML v2 login from your own login page instead of the FusionAuth hosted login pages.

Each SAML v2 AuthN request needs a unique request Id. This API records the Id before the login starts, so FusionAuth can reject a replayed SAML response. FusionAuth generates the Id, or you can provide your own Id in data.requestId.

Put the code from the response in the ID attribute of the SAML AuthN request that you send to the SAML v2 Identity Provider. The SAML v2 Identity Provider returns the code in the InResponseTo attribute of the SAML response, and FusionAuth checks the code when you call the Complete a SAML v2 Login API.

SAML v2 Identity ProviderFusionAuthYour ApplicationSAML v2 Identity ProviderFusionAuthYour ApplicationPOST /api/identity-provider/startcodeAuthN request with ID set to the codeForm POST with a SAMLResponse whose InResponseTo is the codePOST /api/identity-provider/login with data.samlResponseUser object
SAML v2 Identity ProviderFusionAuthYour ApplicationSAML v2 Identity ProviderFusionAuthYour ApplicationPOST /api/identity-provider/startcodeAuthN request with ID set to the codeForm POST with a SAMLResponse whose InResponseTo is the codePOST /api/identity-provider/login with data.samlResponseUser object

Request flow when your own login page uses a SAML v2 Identity Provider.

Request#

Start a SAML v2 login to get the code that completes the login.

No Authentication Required
Start a login request
POST/api/identity-provider/start
OpenAPI Spec

Request Body#

applicationId
  • Type: UUID
  • Required

The Id of the Application the user logs in to. The Application must have SAML v2 login enabled.

data.requestId
  • Type: String
  • Optional

The SAML v2 request Id for the SAML AuthN request. When you leave out this field, FusionAuth generates an Id. FusionAuth returns the Id as the code in the response. FusionAuth doesn't validate an Id that you provide. The Id must be a valid SAML ID, which can't start with a digit.

data.samlAudience
  • Type: String
  • Optional

The audience to expect in the SAML response. When you set this field and the SAML assertion lists audiences, one of the audiences must match this value, or the login fails. When you leave out this field, FusionAuth doesn't compare the audience to an expected value.

data.samlDestination
  • Type: String
  • Optional

The destination to expect in the SAML response, usually the FusionAuth ACS URL. When you set this field and the Destination attribute of the SAML response has a different value, FusionAuth applies the identityProvider.assertionConfiguration.destination.policy of the Identity Provider. When you leave out this field, or the SAML response has no Destination attribute, FusionAuth doesn't check the destination.

identityProviderId
  • Type: UUID
  • Required

The unique Id of the Identity Provider that processes the login request.

connectionTestId
  • Type: String
  • Optional
  • Available since 1.65.0

The Id of a connection test, which the Start an Identity Provider Connection Test API returns. For more information, see Start an Identity Provider Connection Test.

Example Request JSON
{
  "applicationId": "1c212e59-0d0e-6b1a-ad48-f4f92793be32",
  "identityProviderId": "b68026e5-4688-4a9d-b790-a524468c4c9a"
}

Response#

The response contains the code for the Complete a SAML v2 Login API.

Response Codes
CodeDescription
202The request succeeded. The response contains the code for the Complete SAML v2 Login API.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty.
code
  • Type: String

The code that completes the login with the Complete SAML v2 Login API.

Set the ID attribute of your SAML AuthN request to this value. The SAML v2 Identity Provider returns the value in the InResponseTo attribute of the SAML response. FusionAuth checks the value when you call the Complete SAML v2 Login API. The code works once, and expires after the time set in the Tenant's externalIdentifierConfiguration.samlv2AuthNRequestIdTimeToLiveInSeconds.

Example Response JSON
{
  "code": "id62bb157cb5a84abe858e0877a39bccda"
}

Complete a SAML v2 Login#

Use this API to complete a SAML v2 login from your own login page, after the user logs in with a SAML v2 Identity Provider. When you use the FusionAuth hosted login pages, you don't need this API.

For example, your login page can show a Login with Pied Piper button for a third-party SAML v2 Identity Provider. After the user logs in, the SAML v2 Identity Provider sends the user back to your application with a form POST. The form POST contains a SAMLResponse parameter. Pass the SAMLResponse to this API, and FusionAuth completes the login and reconciles the user.

Depending on the linking strategy, the user doesn't need to exist in FusionAuth before you call this API. FusionAuth reads the user's information from the SAMLResponse. When the user doesn't exist, FusionAuth can create the user.

When createRegistration is enabled for the Identity Provider and the user has no Registration for the Application, FusionAuth creates the Registration. FusionAuth gives the new Registration the default roles of the Application.

When createRegistration is disabled, FusionAuth doesn't create a missing Registration. When you provision users by hand before the users log in with the Identity Provider, disable createRegistration.

Request#

Complete the SAML v2 login with the SAMLResponse from the SAML v2 Identity Provider.

No Authentication Required
Complete SAML v2 Login
POST/api/identity-provider/login
OpenAPI Spec

Request Headers#

X-Forwarded-For
  • Type: String
  • Optional

The IP address of the client that requests authentication. When FusionAuth has an IP address, FusionAuth stores the IP address in the login record of the user. When the request body includes ipAddress, FusionAuth uses the request body value instead of this header. Prefer the request body.

X-FusionAuth-TenantId
  • Type: String
  • Optional

The unique Id of the tenant used to scope this API request.

The tenant Id is not required on this request even when more than one tenant has been configured because the tenant can be identified based upon other values in the request or it is otherwise not required.

Specify a tenant Id on this request when you want to ensure the request is scoped to a specific tenant. The tenant Id may be provided through this header or by using a tenant locked API key to achieve the same result.

See Making an API request using a Tenant Id for additional information.

Request Body#

applicationId
  • Type: UUID
  • Required

The Id of the Application the user logs in to. The Application must have SAML v2 login enabled.

data.samlResponse
  • Type: String
  • Required

The SAMLResponse parameter that the SAML v2 Identity Provider sends in a form POST. The InResponseTo attribute of the SAML response must match the code from the Start a SAML v2 Login Request API.

eventInfo
  • Type: Object
  • Optional

Information about the request. FusionAuth adds the information to the events the request triggers, as event.info. For more information, see Pass Context From API Requests to Webhooks.

eventInfo.data
  • Type: Object
  • Optional

An object that holds any JSON you choose, such as a trace Id. FusionAuth copies the object to event.info.data without changes.

eventInfo.deviceDescription
  • Type: String
  • Optional

A description of the end user's device. When this value is omitted, FusionAuth uses metaData.device.description.

eventInfo.deviceName
  • Type: String
  • Optional

The name of the end user's device. When this value is omitted, FusionAuth uses metaData.device.name.

eventInfo.deviceType
  • Type: String
  • Optional

The type of the end user's device. When this value is omitted, FusionAuth uses metaData.device.type.

eventInfo.ipAddress
  • Type: String
  • Optional

The IP address of the end user. When your server calls FusionAuth for the end user, set this value to the end user's IP address. When this value is omitted, FusionAuth uses ipAddress. When both values are omitted, FusionAuth uses the IP address of the client that sent the request.

eventInfo.os
  • Type: String
  • Optional

The operating system of the end user's device.

eventInfo.userAgent
  • Type: String
  • Optional

The user agent of the end user's browser.

identityProviderId
  • Type: UUID
  • Required

The unique Id of the Identity Provider that processes the login request.

connectionTestId
  • Type: String
  • Optional
  • Available since 1.65.0

The Id of a connection test, which the Start an Identity Provider Connection Test API returns. For more information, see Start an Identity Provider Connection Test.

ipAddress
  • Type: String
  • Optional

The IP address of the end user who logs in. When you leave out ipAddress, FusionAuth uses the X-Forwarded-For header, or the address of the last proxy that sent the request. FusionAuth stores the IP address in the user's login history.

metaData.device.description
  • Type: String
  • Optional

A human-readable description of the device.

metaData.device.lastAccessedAddress
  • Type: String
  • Optional

The IP address of the login request.

metaData.device.name
  • Type: String
  • Optional

A human-readable name of the device.

metaData.device.type
  • Type: String
  • Optional

The type of device. In 1.46.0 and later, the value can be any string. Before 1.46.0, the value must be one of the following types:

  • BROWSER
  • DESKTOP
  • LAPTOP
  • MOBILE
  • OTHER
  • SERVER
  • TABLET
  • TV
  • UNKNOWN
newDevice
  • Type: Boolean
  • Optional
  • Defaults to false

Whether the user has never logged in from the device. FusionAuth uses the value as one signal when deciding whether to issue an MFA challenge for Intelligent MFA or the MFA Requirement Lambda. When true, FusionAuth also sends the New Device Webhook.

noJWT
  • Type: Boolean
  • Optional
  • Defaults to false

When true, FusionAuth doesn't issue a JWT. The response body has no token field, and FusionAuth doesn't write the access_token and refresh_token cookies.

When you send many login requests and don't use the JWT, set noJWT to true. FusionAuth then skips signing JWTs.

noLink
  • Type: Boolean
  • Optional
  • Defaults to false
  • Available since 1.29.0

When true and no link to a FusionAuth user exists, FusionAuth returns a 404 status code instead of applying the linking strategy. Use noLink to check for a link before you start an interactive linking workflow with the user.

Example Request JSON
{
  "applicationId": "10000000-0000-0002-0000-000000000001",
  "data": {
    "samlResponse": "PHNhbWxwOlJlc3BvbnNlIElEPSJfYzgxODM3YWMtNjQ2NS00MWNjLWExMDItNjI1N2Q3MTEyNDczIiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAxOS0wMi0yOFQxODoyOTo1NS40NzNaIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly9sb2NhbC5mdXNpb25hdXRoLmlvL29hdXRoMi9jYWxsYmFjayIgSW5SZXNwb25zZVRvPSJpZDMxZjgzYjM1LTU5NTQtNGI2Ny1hY2Y4LTc2M2MxNWZjM2FhYyIgeG1sbnM6c2FtbHA9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCI+PElzc3VlciB4bWxucz0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiI+aHR0cHM6Ly9zdHMud2luZG93cy5uZXQvYzIx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46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YWM6Y2xhc3NlczpQYXNzd29yZDwvQXV0aG5Db250ZXh0Q2xhc3NSZWY+PC9BdXRobkNvbnRleHQ+PC9BdXRoblN0YXRlbWVudD48L0Fzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg=="
  },
  "identityProviderId": "19544aa2-d634-4859-b193-e57af82b5d12",
  "ipAddress": "192.168.1.42"
}

Response#

The response contains the User object.

Response Codes
CodeDescription
200

The authentication succeeded. The response contains the authenticated User object.

202

The authentication succeeded, but the user isn't registered for the Application in the applicationId of the request.

The response contains the authenticated User object.

203

The authentication succeeded, but the user must change the password. The response contains the changePasswordId for the Change Password API.

Example Response JSON
{
  "changePasswordId": "XOgai4Ro68xfGiex0ngXiJ2bbhduM4Pm7h3lvF0xibQ",
  "changePasswordReason": "Expired"
}
204

The login waits on an action by the user. Wait, and then send the request again.

212

The identity that the user logged in with, such as an email address or phone number, isn't verified yet. The response contains the authenticated User object. When the verification strategy is FormField, the response also contains the emailVerificationId that FusionAuth generated for the user. The response can also contain an identityVerificationId.

213

The Registration of the user isn't verified yet. The response contains the authenticated User object. When the verification strategy is FormField, the response also contains the registrationVerificationId that FusionAuth generated for the user.

Before version 1.27.0, FusionAuth returned 200 instead of this status code.

232

The Identity Provider uses the CreatePendingLink linking strategy, and the user has no link. The response contains only the pendingIdPLinkId, and possibly threatsDetected. To link the user, call the Complete a Pending Link API. After FusionAuth links the user, call this API again to log in.

Example Response JSON
{
  "pendingIdPLinkId": "0TxfELqDE0d2Y6PqCkztz4o-lXdRyAscAXh8EAyRZsx"
}
242

The authentication succeeded, and the user has two-factor authentication enabled. In 1.42.0 and later, FusionAuth also returns this status code when two-factor authentication is required. The response contains the twoFactorId for the Complete Two-Factor Authentication API.

Example Response JSON
{
  "methods": [
    {
      "authenticator": {
        "algorithm": "HmacSHA1",
        "codeLength": 6,
        "timeStep": 30
      },
      "id": "2KSZ",
      "method": "authenticator"
    },
    {
      "email": "richard@fusionauth.io",
      "id": "KLRT",
      "method": "email"
    }
  ],
  "twoFactorId": "YkQY5Gsyo4RlfmDciBGRmvfj3RmatUqrbjoIZ19fmw4"
}
400

The request was invalid or malformed, or a login validation lambda rejected the login. The response contains an Errors JSON object with the specific errors.

401

FusionAuth couldn't complete the login. For example, the Identity Provider isn't enabled for the Application, FusionAuth couldn't verify the response from the Identity Provider, or FusionAuth couldn't reconcile the user.

404

FusionAuth didn't find the user, or no Link to the user exists and either the linking strategy is Disabled or the request set noLink to true. The response is empty.

409

An action on the user prevents login. The response contains the actions that prevent login.

Example Response JSON
{
  "actions": [
    {
      "actionId": "00000000-0000-0000-0000-000000000042",
      "actionerUserId": "00000000-0000-0001-0000-000000000000",
      "expiry": 1571786483322,
      "localizedName": "Prevent Login Action",
      "localizedReason": "Hard Lock",
      "name": "Prevent Login Action",
      "reason": "Hard Lock",
      "reasonCode": "hard_lock"
    }
  ]
}
410

The user has expired. The response is empty.

500

FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response is empty.

503

The search index is unavailable or returned an error, so FusionAuth can't complete the request. The response contains a JSON body.

504

One or more webhook endpoints returned an invalid response or were unreachable. Because of the transaction configuration for the event, FusionAuth can't complete the request. FusionAuth logs a stack trace in the FusionAuth log files.

Response Cookies#

access_token
  • Type: String

The access token, an encoded JSON Web Token (JWT). FusionAuth writes the access token as an HTTP-only session cookie.

refresh_token
  • Type: String

The refresh token. FusionAuth writes the refresh token as an HTTP-only persistent cookie. The cookie lasts as long as the refresh token time to live in the JWT configuration of the Tenant. When the Application enables its own JWT configuration, the time to live of the Application applies instead.