# Test SSO connection

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Test SSO connection"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v1/organization/{organization_id}/sso-connections/test-connection"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Validates identity-provider settings without persisting a connection: checks OIDC discovery metadata or SAML IdP reachability so misconfiguration surfaces before the connection is saved.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
  children={"Request"}
>
</Heading>

<ParamsDetails
  parameters={[{"description":"Unique identifier of the organization that owns the SSO connection.","in":"path","name":"organization_id","required":true,"schema":{"description":"Unique identifier of the organization that owns the SSO connection.","format":"uuid","title":"Organization Id","type":"string"}}]}
>
  
</ParamsDetails>

<RequestSchema
  title={"Body"}
  body={{"content":{"application/json":{"schema":{"properties":{"oidc_well_known_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"OIDC discovery URL to validate. Required when testing an OIDC provider.","title":"OIDC Discovery URL"},"provider_type":{"description":"SSO protocol to validate: 'OIDC' or 'SAML'.","title":"Provider Type","enum":["OIDC","SAML"],"type":"string"},"sso_url":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"SAML IdP SSO URL to check for reachability. Required when testing a SAML provider.","title":"SAML SSO URL"}},"required":["provider_type"],"title":"SSOConnectionTestRequest","type":"object"}}},"required":true}}
>
  
</RequestSchema>

<StatusCodes
  id={undefined}
  label={undefined}
  responses={{"200":{"content":{"application/json":{"schema":{"properties":{"discovered":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"description":"Metadata discovered from the identity provider during the test (for example OIDC endpoints).","title":"Discovered Metadata"},"message":{"description":"Human-readable outcome of the connection test.","title":"Result Message","type":"string"},"valid":{"description":"Whether the provided identity-provider configuration passed validation.","title":"Valid","type":"boolean"}},"required":["valid","message"],"title":"SSOConnectionTestResult","type":"object"}}},"description":"Successful Response"},"422":{"content":{"application/json":{"schema":{"properties":{"detail":{"items":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"}}},"description":"Validation Error"}}}
>
  
</StatusCodes>
