0Pricing
OAuth2 & OpenID Connect Deep Dive · Lektion

OIDC-Discovery-Endpunkt

Lernen Sie, wie der OIDC-Discovery-Endpunkt Clients ermöglicht, alle erforderlichen OIDC-Konfigurationsinformationen programmgesteuert abzurufen.

OIDC-Discovery-Endpunkt ist eine kostenlose OAuth2 & OpenID Connect Deep Dive-Lektion auf CoddyKit. Dies ist Lektion 2 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des OAuth2 & OpenID Connect Deep Dive-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der OAuth2 & OpenID Connect Deep Dive-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

What is OIDC Discovery?

Imagine you're building an application that needs to connect to an OpenID Provider (IdP) like Google or Auth0. How do you know its authorization URL, token URL, or how to get its public keys?

Manually configuring these details for every IdP is tedious and error-prone. This is where OIDC Discovery comes in!

The Discovery Endpoint

OIDC Discovery provides a standardized way for clients to find all the necessary configuration information of an OpenID Provider.

Instead of hardcoding URLs, your client application can fetch a single JSON document from a well-known URL. This document contains all the endpoints and capabilities of the IdP.

Finding the Discovery Document

Clients typically access the OIDC Discovery document at a specific, standardized URL:

  • Base URL of the OpenID Provider
  • Followed by /.well-known/openid-configuration

For example, if your IdP's base URL is https://accounts.example.com, the discovery endpoint would be https://accounts.example.com/.well-known/openid-configuration.

Key Fields: Issuer & JWKS URI

The discovery document is a JSON object with many fields. Two crucial ones are:

  • issuer: A URL that uniquely identifies the OpenID Provider. It must match the iss claim in ID Tokens.
  • jwks_uri: The URL of the JSON Web Key Set (JWKS) document. This document contains the public keys used by the IdP to sign ID Tokens, allowing your client to verify their authenticity.

Key Fields: Endpoints

The discovery document lists the various endpoints your client will interact with:

  • authorization_endpoint: Where the user is redirected to grant consent.
  • token_endpoint: Where the client exchanges the authorization code for access and ID tokens.
  • userinfo_endpoint: Where the client can request user profile information after obtaining an access token.
  • end_session_endpoint: (Optional) Where the client can redirect the user to log out from the IdP.

Key Fields: Capabilities

The document also declares the IdP's capabilities:

  • scopes_supported: A list of the OAuth 2.0 scope values that this IdP supports.
  • response_types_supported: A list of the OAuth 2.0 response_type values that this IdP supports.
  • grant_types_supported: (Optional) A list of the OAuth 2.0 grant_type values that this IdP supports.

These help your client understand what features are available.

Example Discovery Document

Here's a simplified example of what an OIDC Discovery document might look like:

{
  "issuer": "https://example.com/openid",
  "authorization_endpoint": "https://example.com/openid/auth",
  "token_endpoint": "https://example.com/openid/token",
  "userinfo_endpoint": "https://example.com/openid/userinfo",
  "jwks_uri": "https://example.com/openid/jwks",
  "scopes_supported": [
    "openid",
    "profile",
    "email"
  ],
  "response_types_supported": [
    "code",
    "id_token",
    "token id_token"
  ],
  "grant_types_supported": [
    "authorization_code",
    "implicit",
    "refresh_token"
  ],
  "id_token_signing_alg_values_supported": [
    "RS256"
  ]
}

How Clients Use Discovery

A client application can perform OIDC Discovery by:

  1. Fetching the JSON document from the /.well-known/openid-configuration endpoint.
  2. Parsing the JSON to extract the necessary URLs and capabilities.
  3. Using these dynamically discovered values to construct authorization requests, exchange tokens, and validate ID Tokens.

This makes client integration much more robust and future-proof.

Benefits of Discovery

Using OIDC Discovery offers several advantages:

  • Reduced Configuration: Clients don't need to hardcode IdP endpoints.
  • Increased Flexibility: IdPs can change endpoint URLs without breaking clients.
  • Enhanced Security: Clients can easily find the jwks_uri to verify ID Token signatures.
  • Interoperability: Promotes a standardized way for clients to interact with any OIDC-compliant IdP.

Test Your Knowledge

Which of the following fields in the OIDC Discovery document is used by a client to verify the signature of an ID Token?

Recap: OIDC Discovery

We've learned that OIDC Discovery provides a standardized way for clients to find an OpenID Provider's configuration.

  • Clients access a well-known /.well-known/openid-configuration endpoint.
  • The returned JSON document contains essential URLs (authorization, token, userinfo, jwks) and capabilities (scopes, response types).
  • This automation simplifies client setup, improves flexibility, and enhances security by providing necessary public keys for token validation.

Häufig gestellte Fragen

Ist die Lektion „OIDC-Discovery-Endpunkt“ kostenlos?

Ja — der vollständige Text von „OIDC-Discovery-Endpunkt“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des OAuth2 & OpenID Connect Deep Dive-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der OAuth2 & OpenID Connect Deep Dive-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „OIDC-Discovery-Endpunkt“?

Lernen Sie, wie der OIDC-Discovery-Endpunkt Clients ermöglicht, alle erforderlichen OIDC-Konfigurationsinformationen programmgesteuert abzurufen. Du übst OAuth2 & OpenID Connect Deep Dive mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um OAuth2 & OpenID Connect Deep Dive zu starten?

Keine Vorkenntnisse erforderlich. OAuth2 & OpenID Connect Deep Dive auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 2 von 4.

Wie lange dauert die Lektion „OIDC-Discovery-Endpunkt“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser OAuth2 & OpenID Connect Deep Dive-Lektion Code schreiben und ausführen?

Ja. Jede OAuth2 & OpenID Connect Deep Dive-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. Dynamische Client-Registrierung
  2. OIDC-Discovery-Endpunkt
  3. Sitzungsverwaltung
  4. Claims Requests und aggregierte Claims
← Zurück zu OAuth2 & OpenID Connect Deep Dive