Docs

getSamlConnectionList()

Retrieves the list of SAML connections for an instance.

function getSamlConnectionList(params: SamlConnectionListParams = {}): Promise<SamlConnection[]>
  • Name
    limit?
    Type
    number
    Description

    The number of results to return. Must be an integer greater than zero and less than 501. Default: 10

  • Name
    offset?
    Type
    number
    Description

    The number of results to skip. Default: 0

Examples

Basic

In this example, you can see that the returned response includes data, which is an array of SamlConnection objects, and totalCount, which indicates the total number of connections.

While the response can return up to 10 data items, for the sake of brevity, only one is shown in this example response.

const response = await clerkClient.samlConnections.getSamlConnectionList()

console.log(response)
/*
{
  data: [
    {
      object: 'saml_connection',
      id: 'samlc_123',
      name: 'test-okta',
      domain: 'clerk.dev',
      idp_entity_id: 'http://www.okta.com/exk...',
      idp_sso_url: 'https://trial-000000.okta.com/app/trial-000000_clerkdocstest_1/exk.../sso/saml',
      idp_certificate: 'MII...',
      idp_metadata_url: 'https://trial-000000.okta.com/app/exk.../sso/saml/metadata',
      idp_metadata: null,
      acs_url: 'https://prepared-phoenix-00.clerk.accounts.dev/v1/saml/acs/samlc_123',
      sp_entity_id: 'https://prepared-phoenix-00.clerk.accounts.dev/saml/samlc_123',
      sp_metadata_url: 'https://prepared-phoenix-00.clerk.accounts.dev/v1/saml/metadata/samlc_123.xml',
      attribute_mapping: { user_id: '', email_address: '', first_name: '', last_name: '' },
      active: false,
      provider: 'saml_okta',
      user_count: 0,
      sync_user_attributes: true,
      allow_subdomains: false,
      allow_idp_initiated: false,
      created_at: 1720032705432,
      updated_at: 1720032705432
    }
  ],
  totalCount: 1
}
*/

Limit the number of results

Retrieves organization list that is filtered by the number of results.

const { data, totalCount } = await clerkClient.samlConnections.getSamlConnectionList({
  // returns the first 10 results
  limit: 10,
})

Skip results

Retrieves organization list that is filtered by the number of results to skip.

const { data, totalCount } = await clerkClient.samlConnections.getSamlConnectionList({
  // skips the first 10 results
  offset: 10,
})

Backend API (BAPI) endpoint

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

Feedback

What did you think of this content?

Last updated on