createConnection

abstract suspend fun createConnection(request: IB2BCreateSAMLConnectionParameters): B2BCreateSAMLConnectionResponse

Creates a new SAML SSO connection for the organization. Calls the POST /sdk/v1/b2b/sso/saml endpoint. Requires an active session.

Kotlin:

StytchB2B.sso.saml.createConnection(
B2BCreateSAMLConnectionParameters(
displayName = "My SAML IdP",
)
)

iOS:

let params = B2BCreateSAMLConnectionParameters(displayName: "My SAML IdP")
let response = try await StytchB2B.sso.saml.createConnection(params)

React Native:

StytchB2B.sso.saml.createConnection({ displayName: "My SAML IdP" })

Return

B2BCreateSAMLConnectionResponse containing the newly created connection.

Parameters

request
  • IB2BCreateSAMLConnectionParameters

  • displayName? — Human-readable label for the connection.

  • identityProvider? — The identity provider type (e.g. "okta", "google", "generic").

Throws

StytchError

if the request fails.

if the coroutine is cancelled.