wihan/dev

docs /clerk / resources

markdown
browse the clerk docs

clerk_saml_connection (Resource)

A SAML connection for enterprise SSO.

Example Usage

resource "clerk_saml_connection" "okta" {
  name         = "Okta"
  domain       = "example.com"
  provider_key = "saml_okta"

  idp_metadata_url = "https://example.okta.com/app/abc123/sso/saml/metadata"

  active           = true
  allow_subdomains = true
}

# Configure these two values at the identity provider.
output "saml_acs_url" {
  value = clerk_saml_connection.okta.acs_url
}

output "saml_sp_entity_id" {
  value = clerk_saml_connection.okta.sp_entity_id
}

Schema

Required

  • domain (String) Email domain of the users of this connection, for example example.com.
  • name (String) Connection name.
  • provider_key (String) Identity provider key: saml_custom, saml_okta, saml_google, or saml_microsoft. A change forces a replacement.

Optional

  • active (Boolean) Enable the connection for sign-ins.
  • allow_idp_initiated (Boolean) Allow identity-provider-initiated flows.
  • allow_subdomains (Boolean) Match subdomains of domain too.
  • force_authn (Boolean) Force re-authentication at the identity provider on each sign-in.
  • idp_certificate (String) X.509 certificate of the identity provider.
  • idp_entity_id (String) Entity id of the identity provider.
  • idp_metadata_url (String) Metadata URL of the identity provider. Clerk fills the idp fields from it.
  • idp_sso_url (String) Single-sign-on URL of the identity provider.
  • organization_id (String) Restrict the connection to one organization.
  • sync_user_attributes (Boolean) Update user attributes from the identity provider on each sign-in.

Read-Only

  • acs_url (String) Assertion consumer service URL — configure this at the identity provider.
  • id (String) SAML connection id (samlc_...).
  • sp_entity_id (String) Service provider entity id — configure this at the identity provider.
  • sp_metadata_url (String) Service provider metadata URL.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

terraform import clerk_saml_connection.okta samlc_2abcDEFghiJKLmnoPQRstuVWXyz