Course contentsShow
← Security
Lesson 773 of 3,05216. Web Security - Authentication MechanismsFree lesson

OIDC Discovery and Dynamic Registration

Leveraging the discovery endpoint (.well-known/openid-configuration) and dynamic client registration for flexible integrations.

OIDC Discovery and Dynamic Registration

You'll learn how OpenID Connect providers advertise their capabilities and allow clients to register automatically, enabling flexible, scalable integrations.

The Problem: Manual Configuration is Brittle

Imagine needing to manually configure every app integration: which endpoints to use, what signing algorithms are supported, where to send authentication requests. This is error-prone and breaks when providers update their infrastructure.

Discovery: The Well-Known Configuration

OIDC providers publish their metadata at a discovery endpoint, always located at:

https://provider.com/.well-known/openid-configuration

This endpoint returns a JSON document listing everything a client needs:

  • authorization_endpoint – where to send authentication requests
  • token_endpoint – where to exchange authorization codes
  • userinfo_endpoint – where to retrieve user claims
  • Supported scopes, response types, signing algorithms, and more

Think of it like a business card: instead of guessing how to contact someone, you read their card to get their email, phone, and office location.

Example Discovery Response

{
  "issuer": "https://provider.com",
  "authorization_endpoint": "https://provider.com/oauth/authorize",
  "token_endpoint": "https://provider.com/oauth/token",
  "userinfo_endpoint": "https://provider.com/userinfo",
  "jwks_uri": "https://provider.com/jwks",
  "scopes_supported": ["openid", "profile", "email"]
}

Dynamic Registration: Automatic Client Setup

Rather than manually registering through a dashboard, dynamic client registration lets your app programmatically register itself by POSTing to the provider's registration_endpoint (found in discovery).

The provider returns client credentials (client_id, sometimes client_secret) automatically—ideal for multi-tenant SaaS or automated deployments.

Key Takeaway: OIDC discovery provides self-documenting provider metadata at .well-known/openid-configuration, while dynamic registration automates client onboarding, making integrations flexible and maintainable.