Skip to content

parseDiscoveryResponse

parseDiscoveryResponse(data, expectedIssuer): OidcDiscovery

Defined in: packages/core/src/discovery.ts:47

Validates and parses a raw OpenID Provider Configuration response into an OidcDiscovery object.

Checks that all required string and array fields are present, and that the returned issuer exactly matches expectedIssuer (after trailing-slash normalization).

unknown

The raw JSON-parsed discovery response body.

string

The issuer identifier the caller originally requested.

OidcDiscovery

A validated OidcDiscovery object.

DISCOVERY_INVALID if required fields are missing or the response is not an object.

DISCOVERY_ISSUER_MISMATCH if the returned issuer does not match expectedIssuer.

OpenID Connect Discovery 1.0 §4.3 — OpenID Provider Configuration Response