Skip to content

Relax client_id validation in AtJwtBuilder#18890

Open
gbaso wants to merge 1 commit intospring-projects:mainfrom
gbaso:gh-18381-client_id
Open

Relax client_id validation in AtJwtBuilder#18890
gbaso wants to merge 1 commit intospring-projects:mainfrom
gbaso:gh-18381-client_id

Conversation

@gbaso
Copy link
Contributor

@gbaso gbaso commented Mar 13, 2026

AtJwtBuilder currently requires configuring a specific client_id value, and tokens that containing a different client_id are rejected. As discussed in #18381 (comment), this is a stronger requirement than that specified in RFC 9068, which only requires that a client_id claim is present.

In scenarios like the client_credentials grant type, multiple clients may obtain tokens from the same issuer and call the same resource server. In these cases, the resource server may not even know all possible client_id values in advance.

This change relaxes the default behavior of AtJwtBuilder so that it validates only the presence of the client_id claim. A specific value can still be required by calling AtJwtBuilder#clientId(...), just as before.

Relates to gh-18381

RFC 9068 requires that access token JWTs include the `client_id`
claim, but it does not require resource servers to validate it against
a specific value.

Relates to spring-projectsgh-18381

Signed-off-by: Giacomo Baso <gbaso@users.noreply.github.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants