Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#51,008 0 comentarios 1 reacción 3 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@domainname ya está trabajando en esto.

Desde el 29/10/2026.

  • #51030 de @moarychan — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
azure, java, spring-boot

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Java
Estrellas
2.6k
Forks
2.2k
Merge medio
2 d 3 h
PR fusionados (30 d)
230

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Azure/azure-sdk-for-java

Todos los issues de Azure/azure-sdk-for-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.