IAM glossary
What is Discovery document?
The JSON at /.well-known/openid-configuration that describes an OpenID provider: issuer, endpoints, JWKS URL and supported features. Clients configure themselves from it.
How it works
The discovery document is a JSON file that an OpenID Connect provider publishes at https://<issuer>/.well-known/openid-configuration. It lists everything a client needs: the issuer name, the authorization, token, userinfo and logout endpoints, the URL of the public keys (jwks_uri), the supported scopes, flows and signing algorithms.
With it, a library can configure itself from a single URL instead of you copying a dozen endpoints by hand. It also lets you check a provider’s settings: does it support PKCE? Which algorithms does it sign with?
A simple example
You need to connect an app to Okta. Instead of searching the documentation, you open https://example.okta.com/.well-known/openid-configuration and find "token_endpoint": "https://example.okta.com/oauth2/v1/token" and "code_challenge_methods_supported": ["S256"]. Your OIDC library only needs the issuer URL and reads the rest.
Common mistakes
- Copying endpoints by hand and never updating them when the provider changes them.
- Not checking that the
issuerin the document matches theissin the tokens. - Fetching it on every login instead of caching it for a reasonable time.