B2B Saas Authentication

/

Frontend SDKs

/

Headless

/

SSO

/

Update External Connection

Update External Connection

The Update External Connection method wraps the Update External Connection API endpoint. The organization_id will be automatically inferred from the logged-in Member's session. This method cannot be used to update External connections in other Organizations.


Method parameters


connection_id*string

display_namestring

external_connection_implicit_role_assignmentsarray[object]

external_group_implicit_role_assignmentsarray[object]

Response fields


request_idstring

status_codeint

connectionobject
import { useStytchB2BClient } from '@stytch/react/b2b';

export const UpdateExternalConnection = () => {
  const stytch = useStytchB2BClient();

  const updateExternalConnection = () => {
    stytch.sso.external.updateConnection({
      connection_id: 'external-connection-test-5c44cc6a-8af7-48d6-8da7-ea821342f5a6',
      display_name: 'Example External Connection',
    });
  };

  return <button onClick={updateExternalConnection}>Update External Connection</button>;
};

RESPONSE

200
{
	"connection": {
		"connection_id": "external-connection-test-5c44cc6a-8af7-48d6-8da7-ea821342f5a6",
		"display_name": "Example External Connection",
		"organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931",
		"external_organization_id": "organization-test-ca6dbe77-10e5-4403-805a-b117c55c24c6",
		"external_connection_id": "saml-connection-test-51861cbc-d3b9-428b-9761-227f5fb12be9",
		"status": "active",
		"external_connection_implicit_role_assignments": [
            {
                "role_id": "admin"
            }
        ],
        "external_group_implicit_role_assignments": [
            {
                "role_id": "editor",
                "group": "editors"
            },
            {
                "role_id": "reader",
                "group": "readers"
            }
        ]
	},
	"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
	"status_code": 200
}