Skip to main content

createSamlConnection(),

Deprecated

This method is deprecated. Use createEnterpriseConnection() instead.

Creates a new SamlConnection for an identity provider ().

function createSamlConnection(params: CreateSamlConnectionParams): Promise<SamlConnection>
  • Name
    attributeMapping?
    Type
    { emailAddress?: string, firstName?: string, lastName?: string, userId?: string }
    Description

    The attribute mapping for the SAML connection.

  • Name
    domain
    Type
    string
    Description

    The domain of your Organization. Sign in flows using an email with this domain will use this SAML Connection. For example: 'clerk.dev'

  • Name
    idpCertificate?
    Type
    string
    Description

    The X.509 certificate as provided by the IdP.

  • Name
    idpEntityId?
    Type
    string
    Description

    The Entity ID as provided by the IdP.

  • Name
    idpMetadata?
    Type
    string
    Description

    The XML content of the IdP metadata file. If present, it takes priority over the corresponding individual properties.

  • Name
    idpMetadataUrl?
    Type
    string
    Description

    The URL which serves the IdP metadata. If present, it takes priority over the corresponding individual properties.

  • Name
    idpSsoUrl?
    Type
    string
    Description

    The Single-Sign On URL as provided by the IdP.

  • Name
    name
    Type
    string
    Description

    The name to use as a label for this SAML Connection.

  • Name
    organizationId?
    Type
    string
    Description

    The ID of the Organization to which users of this SAML Connection will be added

  • Name
    provider
    Type
    'saml_custom' | 'saml_okta' | 'saml_google' | 'saml_microsoft'
    Description

    The IdP of the connection.

Note

Using clerkClient varies based on the SDK you're using. Refer to the overview for usage details, including guidance on how to access the userId and other properties.

const response = await clerkClient.samlConnections.createSamlConnection({
  name: 'test-okta',
  provider: 'saml_okta',
  domain: 'clerk.dev',
  idpMetadataUrl: 'https://trial-000000.okta.com/app/exk...',
  attributeMapping: {
    emailAddress: 'user.email',
    firstName: 'user.firstName',
    lastName: 'user.lastName',
  },
})

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint POST/saml_connections. See the BAPI reference for more information.

Feedback

What did you think of this content?

Last updated on