updateConnection

abstract suspend fun updateConnection(connectionId: String, request: IB2BUpdateSAMLConnectionParameters): B2BUpdateSAMLConnectionResponse

Updates an existing SAML SSO connection. Calls the PUT /sdk/v1/b2b/sso/saml/{connection_id} endpoint. Requires an active session.

Kotlin:

StytchB2B.sso.saml.updateConnection(
connectionId = "saml-connection-test-d5a3b680-e8a3-40c0-b815-ab79986666d0",
request = B2BUpdateSAMLConnectionParameters(
displayName = "Updated IdP",
idpSsoUrl = "https://idp.example.com/sso",
),
)

iOS:

let params = B2BUpdateSAMLConnectionParameters(
displayName: "Updated IdP",
idpSsoUrl: "https://idp.example.com/sso"
)
let response = try await StytchB2B.sso.saml.updateConnection(
connectionId: "saml-connection-test-d5a3b680-e8a3-40c0-b815-ab79986666d0",
request: params
)

React Native:

StytchB2B.sso.saml.updateConnection(
"saml-connection-test-d5a3b680-e8a3-40c0-b815-ab79986666d0",
{ displayName: "Updated IdP", idpSsoUrl: "https://idp.example.com/sso" },
)

Return

B2BUpdateSAMLConnectionResponse containing the updated connection.

Parameters

connectionId

The ID of the SAML connection to update.

request
  • IB2BUpdateSAMLConnectionParameters

  • idpEntityId? — The IdP entity ID.

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

  • attributeMapping? — Map of IdP attributes to Stytch member fields.

  • x509Certificate? — PEM-encoded X.509 certificate from the IdP.

  • idpSsoUrl? — The IdP SSO URL.

  • samlConnectionImplicitRoleAssignments? — Roles assigned to all members via this connection.

  • samlGroupImplicitRoleAssignments? — Roles assigned based on SAML group membership.

  • alternativeAudienceUri? — Alternative audience URI for the SAML assertion.

  • identityProvider? — The identity provider type.

  • signingPrivateKey? — Private key used to sign SAML requests.

  • allowGatewayCallback? — Whether to allow gateway callback.

Throws

StytchError

if the connection is not found or the request fails.

if the coroutine is cancelled.