An OIDC Discovery Document is a machine-readable file that tells clients how to use an OpenID Connect identity provider. It publishes endpoints, supported features, signing keys, and issuer details in a standard JSON format, usually at a well-known URL. This enables automated configuration and reduces manual integration errors.
What the discovery document does
An OIDC Discovery Document is the client-facing control plane for OpenID Connect integration. It tells relying parties where to send users, where to validate tokens, which signing keys to trust, and which response modes and algorithms the provider supports, so integrations can be configured consistently instead of by hand.
That makes the document more than convenience metadata. If clients consume it correctly, they can discover the issuer, endpoints, and key material automatically; if they consume it poorly, the document becomes part of the trust decision for authentication itself.
Why it matters in OIDC integration
Discovery reduces brittle, environment-specific configuration and helps clients remain aligned with the identity provider as endpoints or key sets change. It is especially valuable in federated environments where many applications need the same IdP details and where manual copying of URLs, issuer values, or JWKS locations creates avoidable failures.
The same convenience also concentrates trust. A client that accepts the wrong issuer, follows a manipulated metadata endpoint, or caches key material incorrectly can end up validating tokens against the wrong authority or trusting signatures that should not be trusted.
Used well, discovery supports interoperability, faster onboarding, and safer automation. Used carelessly, it can hide a misconfiguration until login failures or token validation problems surface in production.
What is published in the document
In practice, the document advertises the provider details a client needs to complete the OIDC flow. That usually includes the issuer identifier, authorization and token endpoints, JWKS endpoint, supported scopes and claims, and cryptographic capabilities such as signing algorithms.
The document is typically served from a well-known location, which lets clients discover the configuration without bespoke setup. A well-known URL also makes consistency easier across environments, but it raises the bar for correctness because every client may use the same metadata as its starting point.
OpenID Connect Core 1.0 defines the OIDC model that discovery supports, while OAuth 2.0 and OpenID Connect Guide for Identity Teams gives the integration context around roles, tokens, and common implementation mistakes.
Security assumptions and failure modes
Discovery assumes that the metadata source is authentic, the issuer value matches the tokens being received, and the keys advertised by the provider are the keys actually used to sign those tokens. Those assumptions are usually safe only when the client validates them strictly and treats the document as configuration, not as blind truth.
Common failure modes include accepting metadata from the wrong issuer, trusting an unexpected endpoint after environment drift, or failing to notice that a signing key has rotated. Those problems often show up as authentication outages first, but the underlying issue is trust in stale or incorrect provider metadata.
Identity Provider and SSO Security Guide is the most direct internal reference for the trust and hardening issues around IdP configuration, federation, and signing key handling, and RFC 9728: OAuth 2.0 Protected Resource Metadata is useful when you want to compare how metadata-based discovery is being standardised in adjacent OAuth ecosystems.
How practitioners should use it
Practitioners should treat discovery metadata as part of the security boundary for federation, not as a convenience file that can be fetched and accepted without validation. The key questions are whether the issuer is pinned or otherwise verified, whether the JWKS and endpoints are fetched from the expected origin, and whether clients fail closed when metadata is inconsistent.
It is also important to monitor for changes that would alter trust, such as endpoint drift, key rotation, or an unexpected issuer value in a non-production environment that later gets copied into production. In larger estates, those controls are usually more important than the raw mechanics of parsing JSON.
Ultimate Guide to NHIs, Standards is relevant where discovery feeds machine or workload authentication patterns, and SPIFFE and SPIRE Guide is useful when you are comparing OIDC-based discovery with workload identity federation models.
Risk and Threat Considerations
Discovery documents can be abused when clients trust metadata too broadly, because the document helps define the endpoints and signing material that make authentication work. If an attacker can influence what metadata a client consumes, or if a client fails to verify the issuer and key provenance, the result can be token forgery, trust misbinding, or authentication to the wrong identity provider.
Failure mechanism: Weak issuer validation, stale key handling, or reliance on unverified metadata allows the client to build trust on the wrong configuration and accept tokens that should not be accepted.
Impact: The practical consequences include login failure, account takeover through trust confusion, acceptance of forged assertions, and wider federation compromise if the same metadata mistake is reused across applications.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST SP 800-53 Rev 5 and OWASP ASVS set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | IA-2 — Identification and Authentication (Organizational Users) | OIDC discovery supports authenticated access decisions for organizational users. |
| IA-5 — Authenticator Management | The document publishes signing and key-related parameters used to validate tokens. | |
| SC-23 — Session Authenticity | OIDC discovery influences the trust path used to establish authenticated sessions. | |
| Recommendation — Validate issuer metadata before allowing organizational-user authentication flows to proceed. Manage token-signing keys and rotation so discovery metadata stays trustworthy. Verify federation metadata before accepting session-establishing assertions. | ||
| OWASP ASVS | V10 — OAuth and OIDC | OIDC discovery is part of OAuth and OpenID Connect configuration and validation. |
| V12 — Secure Communication | Discovery data must be fetched over trusted transport and from the expected origin. | |
| Recommendation — Apply OIDC validation requirements to issuer, endpoints, and token handling. Enforce secure transport and origin checks when retrieving discovery metadata. | ||
Practitioner Guidance
Governance implication: Treat discovery metadata as a governed dependency with ownership, change control, and validation requirements. The organisation should know who can publish or alter the metadata source, how clients verify issuer and keys, and what happens when the document changes unexpectedly.
Practitioner note: The safest posture is to combine discovery with strict issuer checks, explicit trust anchoring, and monitoring for metadata drift. That keeps the convenience of automatic configuration without turning the discovery endpoint into an unchecked source of authority.
Related resources from NHI Mgmt Group
- What is the difference between WebFinger discovery and the OIDC discovery document in an identity setup?
- How do OIDC discovery and JWKS fit into identity governance?
- Why is NHI discovery and inventory the primary goal of NHI security?
- What is OpenID Connect (OIDC) and how does it extend OAuth 2.0 for NHIs?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 30, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org