updateConnectionByUrl

abstract suspend fun updateConnectionByUrl(connectionId: String, request: IB2BUpdateSAMLConnectionByURLParameters): B2BUpdateSAMLConnectionByURLResponse

Updates a SAML SSO connection by fetching its metadata directly from the provided URL. Calls the PUT /sdk/v1/b2b/sso/saml/{connection_id}/url endpoint. Requires an active session.

Kotlin:

StytchB2B.sso.saml.updateConnectionByUrl(
connectionId = "saml-connection-test-d5a3b680-e8a3-40c0-b815-ab79986666d0",
request = B2BUpdateSAMLConnectionByURLParameters(
metadataUrl = "https://idp.example.com/metadata.xml",
),
)

iOS:

let params = B2BUpdateSAMLConnectionByURLParameters(metadataUrl: "https://idp.example.com/metadata.xml")
let response = try await StytchB2B.sso.saml.updateConnectionByUrl(
connectionId: "saml-connection-test-d5a3b680-e8a3-40c0-b815-ab79986666d0",
request: params
)

React Native:

StytchB2B.sso.saml.updateConnectionByUrl(
"saml-connection-test-d5a3b680-e8a3-40c0-b815-ab79986666d0",
{ metadataUrl: "https://idp.example.com/metadata.xml" },
)

Return

B2BUpdateSAMLConnectionByURLResponse containing the updated connection.

Parameters

connectionId

The ID of the SAML connection to update.

request
  • IB2BUpdateSAMLConnectionByURLParameters

  • metadataUrl — URL from which to fetch the SAML IdP metadata XML.

Throws

StytchError

if the metadata URL is unreachable or the request fails.

if the coroutine is cancelled.