0Pricing
OAuth2 & OpenID Connect Deep Dive · Pelajaran

Endpoint Penemuan OIDC

Pelajari cara endpoint Penemuan OIDC memungkinkan klien mengambil semua informasi konfigurasi OIDC yang diperlukan secara terprogram.

Endpoint Penemuan OIDC adalah pelajaran OAuth2 & OpenID Connect Deep Dive gratis di CoddyKit. Ini adalah pelajaran 2 dari 4. Kamu bisa membaca pelajaran lengkapnya di bawah secara gratis — lalu praktikkan langsung di browser dengan editor kode bawaan dan tutor AI 24/7. Ini adalah bagian dari jalur belajar OAuth2 & OpenID Connect Deep Dive, dan progresmu tersinkronisasi di web dan aplikasi CoddyKit. Kursus OAuth2 & OpenID Connect Deep Dive mencakup 4 pelajaran total.

Bagian dari pelajaran ini belum diterjemahkan dan ditampilkan dalam bahasa Inggris.

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.

Pertanyaan yang Sering Diajukan

Apakah pelajaran “Endpoint Penemuan OIDC” gratis?

Ya — teks lengkap “Endpoint Penemuan OIDC” gratis dibaca di sini di web. Untuk praktiknya secara interaktif (editor kode bawaan dan tutor AI 24/7) dan buka sisa kursus OAuth2 & OpenID Connect Deep Dive, upgrade ke CoddyKit PRO. Kursus OAuth2 & OpenID Connect Deep Dive mencakup 4 pelajaran total.

Apa yang akan aku pelajari di “Endpoint Penemuan OIDC”?

Pelajari cara endpoint Penemuan OIDC memungkinkan klien mengambil semua informasi konfigurasi OIDC yang diperlukan secara terprogram. Kamu berlatih OAuth2 & OpenID Connect Deep Dive dengan kode praktik yang langsung kamu jalankan di browser, dan tutor AI 24/7 menjawab pertanyaanmu saat kamu mengerjakan pelajaran ini.

Apakah aku perlu pengalaman untuk memulai OAuth2 & OpenID Connect Deep Dive?

Tidak diperlukan pengalaman sebelumnya. OAuth2 & OpenID Connect Deep Dive di CoddyKit dirancang untuk pemula hingga pelajar tingkat lanjut, jadi kamu bisa memulai di sini atau dari awal dan belajar sesuai kecepatan kamu sendiri. Ini adalah pelajaran 2 dari 4.

Berapa lama pelajaran “Endpoint Penemuan OIDC” memakan waktu?

Sebagian besar pelajaran CoddyKit memakan waktu sekitar 5–10 menit. Setiap pelajaran ringkas dan interaktif, jadi kamu membuat kemajuan stabil dan melanjutkan dari tempat kamu tinggalkan di web dan aplikasi.

Bisakah aku menulis dan menjalankan kode dalam pelajaran OAuth2 & OpenID Connect Deep Dive ini?

Ya. Setiap pelajaran OAuth2 & OpenID Connect Deep Dive menyertakan editor kode bawaan, jadi kamu menulis dan menjalankan kode nyata langsung di browser dan mendapatkan umpan balik AI instan — tidak diperlukan penyiapan lokal.

Semua pelajaran dalam kursus ini

  1. Pendaftaran Klien Dinamis
  2. Endpoint Penemuan OIDC
  3. Manajemen Sesi
  4. Permintaan Klaim dan Klaim Teragregasi
← Kembali ke OAuth2 & OpenID Connect Deep Dive