Skip to content
Docs
Providers

Validate provider connection

Validate provider connection

zones.providers.validate(strid, ProviderValidateParams**kwargs) -> ValidationResult
POST/zones/{zoneId}/providers/{id}/validate

Runs on-demand OIDC connection checks (issuer reachability, metadata retrieval, endpoint consistency, authorization endpoint reachability, and a demonstration client_credentials exchange) against the provider and returns a per-check result. Results are not persisted.

ParametersExpand Collapse
zone_id: str
id: str
ReturnsExpand Collapse
class ValidationResult:

Result of running the provider OIDC connection checks on demand. Not persisted.

checks: List[Check]

Per-check results, in execution order

check: Literal["issuer_reachability", "metadata_retrieval", "endpoint_consistency", 2 more]

Identifier of an individual provider validation check

Accepts one of the following:
"issuer_reachability"
"metadata_retrieval"
"endpoint_consistency"
"authorization_endpoint_reachability"
"credential_exchange"
status: Literal["pass", "fail", "skipped_with_reason", "not_applicable"]

Outcome of a single check. pass/fail mean the check ran. skipped_with_reason means it could not run because a prerequisite is missing on our side (e.g. no credential stored). not_applicable means the check does not apply to this provider class (e.g. a login-flow-only provider that does not advertise the client_credentials grant) — render as a neutral state, distinct from a failure. Neither skipped_with_reason nor not_applicable fails the overall run.

Accepts one of the following:
"pass"
"fail"
"skipped_with_reason"
"not_applicable"
detail: Optional[str]

Human-readable explanation, present on fail, skipped_with_reason, and not_applicable.

provider_id: str

Provider that was validated

status: Literal["pass", "fail"]

Overall outcome. fail when any individual check failed; skipped checks do not fail the run.

Accepts one of the following:
"pass"
"fail"
validated_at: datetime

When the validation run completed

formatdate-time

Validate provider connection

import os
from keycardai_api import KeycardAPI

client = KeycardAPI(
    api_key=os.environ.get("KEYCARD_API_API_KEY"),  # This is the default and can be omitted
)
validation_result = client.zones.providers.validate(
    id="id",
    zone_id="zoneId",
)
print(validation_result.provider_id)
{
  "checks": [
    {
      "check": "issuer_reachability",
      "status": "pass",
      "detail": "detail"
    }
  ],
  "provider_id": "provider_id",
  "status": "pass",
  "validated_at": "2019-12-27T18:11:19.117Z"
}
Returns Examples
{
  "checks": [
    {
      "check": "issuer_reachability",
      "status": "pass",
      "detail": "detail"
    }
  ],
  "provider_id": "provider_id",
  "status": "pass",
  "validated_at": "2019-12-27T18:11:19.117Z"
}