createConnection

abstract suspend fun createConnection(request: IB2BCreateOIDCConnectionParameters): B2BCreateOIDCConnectionResponse

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

Kotlin:

StytchB2B.sso.oidc.createConnection(
B2BCreateOIDCConnectionParameters(
displayName = "My OIDC IdP",
)
)

iOS:

let params = B2BCreateOIDCConnectionParameters(displayName: "My OIDC IdP")
let response = try await StytchB2B.sso.oidc.createConnection(params)

React Native:

StytchB2B.sso.oidc.createConnection({ displayName: "My OIDC IdP" })

Return

B2BCreateOIDCConnectionResponse containing the newly created connection.

Parameters

request
  • IB2BCreateOIDCConnectionParameters

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

  • identityProvider? — The identity provider type.

Throws

StytchError

if the request fails.

if the coroutine is cancelled.