Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Spring Cloud Azure] Validate tfp/acr claim against configured user-flows in AadB2cResourceServerAutoConfiguration

オープン
#51,008 コメント 0 件 リアクション 1 件 担当者 3 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@domainname がすでに取り組んでいます。

2026年10月29日 から。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
azure, java, spring-boot

調査の方向性

Read AadB2cResourceServerAutoConfiguration.java and AadJwtClaimNames.java, then inspect the existing tests in AadB2cResourceServerAutoConfigurationTests.java. Trace how jwtDecoder builds its validators and how configured user flows are represented. Add coverage for matching tfp, the acr fallback, case-insensitive matching, and rejection of unconfigured flows; done when those cases pass.

索引モデルが issue の本文から書いたものです。

説明

azure-spring azure-spring-aad-b2c Client
Library name and version

com.azure.spring:spring-cloud-azure-autoconfigure 7.4.0

Describe the bug

In AadB2cTrustedIssuerRepository (AadB2cTrustedIssuerRepository.java (lines 43–60)), addB2cUserFlowIssuers() registers policy-specific issuer URIs (<baseUri>/tfp/<tenantId>/<userFlow>/v2.0/) for each configured entry in spring.cloud.azure.active-directory.b2c.user-flows, while addB2cIssuer() also registers the tenant-level issuer URI (<baseUri>/<tenantId>/v2.0/).

When Azure AD B2C tokens use the <baseUri>/<tenantId>/v2.0/ issuer format, the user flow name is carried in the tfp (or acr) claim rather than in the iss path. However, AadB2cResourceServerAutoConfiguration.jwtDecoder (AadB2cResourceServerAutoConfiguration.java (lines 93–118)) only configures validators for aud, tid, iss, and timestamps, and does not check the tfp / acr claim against the configured user-flows when user-flows is populated.

Expected behavior

When spring.cloud.azure.active-directory.b2c.user-flows is configured, AadB2cResourceServerAutoConfiguration.jwtDecoder should validate that the token's tfp (or fallback acr) claim matches one of the configured user flow names in properties.getUserFlows().values(), consistent with how addB2cUserFlowIssuers() scopes /tfp/ issuer URLs to the configured user-flows.

Actual behavior

Tokens using the <baseUri>/<tenantId>/v2.0/ issuer format are only checked against AadJwtIssuerValidator, tid, aud, and timestamps, without checking tfp or acr against properties.getUserFlows().values().

Proposed Improvement
  1. Add TFP ("tfp") and ACR ("acr") constants to AadJwtClaimNames.java.
  2. In AadB2cResourceServerAutoConfiguration.jwtDecoder, when properties.getUserFlows() is non-empty, add a validator checking that tfp (or acr when tfp is absent) matches a configured user flow name (case-insensitively).
  3. Add unit test coverage in AadB2cResourceServerAutoConfigurationTests.java.
主要言語
Java
スター
2.6k
フォーク
2.2k
平均マージ
2日 1時間
マージ済み PR(30日)
225

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Azure/azure-sdk-for-java のほかの issue

Azure/azure-sdk-for-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。