# Create SAML Federation user source

Create a SAML federation user source.
A valid environment token is required to call this endpoint. You can obtain it from the [environment authentication route](/ciam/api/vendor-service/other/authenticate_vendor).

Endpoint: POST /resources/user-sources/v1/saml-federation
Version: 1.0
Security: bearer

## Security:

  - `bearer` (unknown)
    http bearer JWT

## Request fields (application/json):

  - `name` (string, required)
    The user source name

  - `configuration` (object, required)
    User source configuration

  - `configuration.syncOnLogin` (boolean, required)
    Whether to sync user profile attributes on each login

  - `configuration.idpEntityId` (string, required)
    Entity ID of the external SAML IdP

  - `configuration.idpSsoUrl` (string, required)
    SSO URL for HTTP-Redirect binding

  - `configuration.idpCertificate` (string, required)
    IdP signing certificate in PEM format

  - `configuration.spEntityId` (string)
    SP Entity ID. Defaults to https://{vendorHost}/oauth/saml-federation/metadata

  - `configuration.spSigningCertificate` (string)
    SP signing certificate for signed AuthnRequests

  - `configuration.spSigningPrivateKey` (string)
    SP signing private key (encrypted) for signed AuthnRequests

  - `configuration.signAuthnRequest` (boolean)
    Whether to sign AuthnRequests

  - `configuration.attributeMapping` (object)
    Mapping of SAML attributes to user properties

  - `configuration.attributeMapping.email` (string)
    SAML attribute name for email
    Example: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress

  - `configuration.attributeMapping.name` (string)
    SAML attribute name for name
    Example: http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name

  - `configuration.wantAssertionsSigned` (boolean)
    Require signed assertions

  - `configuration.wantResponseSigned` (boolean)
    Require signed response

  - `configuration.tenantConfig` (any, required)

  - `configuration.tenantConfig.tenantIdFieldName` (string, required)
    The attribute name of which the tenant id would be taken from

  - `configuration.tenantConfig.tenantResolverType` (string, required)
    Enum: "dynamic"

  - `configuration.tenantConfig.tenantId` (string, required)
    The tenant id which all of the users would be added to

  - `configuration.tenantConfig.tenantResolverType` (string, required)
    Enum: "static"

  - `configuration.tenantConfig.tenantResolverType` (string, required)
    Enum: "new"

  - `appIds` (array)
    The application ids to assign to this user source

  - `index` (number, required)
    The user source index

  - `description` (string)
    The user source description

## Response 201 fields (application/json):

  - `id` (string, required)

  - `name` (string, required)

  - `type` (string, required)

  - `appIds` (array, required)

  - `description` (string, required)

  - `index` (number, required)

