0Pricing
OAuth2 & OpenID Connect Deep Dive · レッスン

Claims Requestとaggregated Claims

OpenID Connectでclaimsパラメーターを使ってクライアントが特定のクレームを要求する方法と、distributed claimsおよびaggregated claimsで外部ソースからアサーションを提供する仕組みを学びます。

「Claims Requestとaggregated Claims」はCoddyKit上の無料OAuth2 & OpenID Connect Deep Diveレッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはOAuth2 & OpenID Connect Deep Dive学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 OAuth2 & OpenID Connect Deep Diveコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

Requesting Specific Claims

Beyond scopes like profile or email, OIDC offers a finer-grained claims request parameter. It lets a client ask for individual claims and target where they appear: in the ID token or from UserInfo.

The claims Parameter Shape

The claims parameter is a JSON object with two top-level members: id_token and userinfo. Each maps claim names to a value describing how they are requested.

{
  "id_token": { "auth_time": { "essential": true } },
  "userinfo": { "email": null, "email_verified": null }
}

essential, value, values

Each requested claim can specify:

  • essential: true — the client really needs it.
  • value — request that the claim equals a specific value.
  • values — request one of several allowed values.
{ "acr": { "essential": true,
            "values": ["urn:mace:incommon:iap:silver"] } }

Sending It in the Request

The JSON is URL-encoded and sent as the claims query parameter on the authorization request.

GET /authorize?response_type=code
  &client_id=app123&scope=openid
  &claims=%7B%22id_token%22%3A%7B%22auth_time%22%3A%7B%22essential%22%3Atrue%7D%7D%7D

Why Not Just Scopes?

Scopes bundle many claims at once. The claims parameter is for when you need precision — a single specific claim, an essential requirement, or a constraint on its value. It complements scopes rather than replacing them.

Aggregated Claims

Sometimes claims come from a third party the OP trusts. Aggregated claims are bundled by the OP as a signed JWT from the external claims provider and returned inline, so the client gets verifiable assertions without extra calls.

Aggregated Claims Format

The OP references them via _claim_names (which claim came from which source) and _claim_sources (the JWT holding them).

{
  "_claim_names": { "address": "src1" },
  "_claim_sources": {
    "src1": { "JWT": "eyJhbGciOi..." }
  }
}

Distributed Claims

Distributed claims are not embedded; instead the OP gives an endpoint and access token so the client can fetch them directly from the external source when needed.

{
  "_claim_names": { "payment_info": "src2" },
  "_claim_sources": {
    "src2": {
      "endpoint": "https://bank.example.com/claims",
      "access_token": "ksj3n283dke"
    }
  }
}

Aggregated vs Distributed

The trade-off:

  • Aggregated — claims travel inline, fewer round-trips, larger token.
  • Distributed — claims fetched on demand, smaller token, extra request and live availability of the source.

Processing External Claims

For aggregated claims, verify the embedded JWT's signature against the claims provider's keys. For distributed claims, call the endpoint with the supplied access token and validate the returned JWT before trusting any values.

When to Use These

External claim mechanisms shine in federations: an identity provider asserts who you are, while a bank or government source asserts verified attributes. They keep sensitive data at its authoritative source.

Quick Check

Test your understanding of claim requests.

Recap

The claims parameter enables fine-grained, essential, or value-constrained claim requests targeting the ID token or UserInfo.

  • essential, value, and values refine each request.
  • Aggregated claims are embedded inline as signed JWTs.
  • Distributed claims are fetched from an external endpoint.
  • Always verify external claim signatures before trusting them.

よくある質問

「Claims Requestとaggregated Claims」レッスンは無料ですか?

はい。「Claims Requestとaggregated Claims」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、OAuth2 & OpenID Connect Deep Diveコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 OAuth2 & OpenID Connect Deep Diveコースには全4レッスンが含まれています。

「Claims Requestとaggregated Claims」で何を学びますか?

OpenID Connectでclaimsパラメーターを使ってクライアントが特定のクレームを要求する方法と、distributed claimsおよびaggregated claimsで外部ソースからアサーションを提供する仕組みを学びます。 ブラウザで直接実行するハンズオンコードでOAuth2 & OpenID Connect Deep Diveを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

OAuth2 & OpenID Connect Deep Diveを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのOAuth2 & OpenID Connect Deep Diveは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。

「Claims Requestとaggregated Claims」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このOAuth2 & OpenID Connect Deep Diveレッスンでコードを書いて実行できますか?

はい。すべてのOAuth2 & OpenID Connect Deep Diveレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. 動的なクライアント登録
  2. OIDC Discovery Endpoint
  3. セッション管理
  4. Claims Requestとaggregated Claims
← OAuth2 & OpenID Connect Deep Diveに戻る