Skip to content

specs says type in header should at+jwt#990

Closed
arthurchan35 wants to merge 1 commit intoapache:mainfrom
arthurchan35:at+jwt
Closed

specs says type in header should at+jwt#990
arthurchan35 wants to merge 1 commit intoapache:mainfrom
arthurchan35:at+jwt

Conversation

@arthurchan35
Copy link
Contributor

@arthurchan35
Copy link
Contributor Author

@amarkevich
@reta

getJwtAccessTokenProducer() == null ? new OAuthJoseJwtProducer() : getJwtAccessTokenProducer();
return processor.processJwt(new JwtToken(jwtCliams));

JwsHeaders jwsHeaders = new JwsHeaders();
Copy link
Member

@reta reta Aug 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arthurchan35 it does not seem to be solving the problem at large:

  • as you may see in the comment [1], it could be JWS or JWE
  • for JWE, the JwsHeaders are not used, the JweHeaders are

Looking into the right place to apply the spec recommendation, but on more general note, we need to introduce a member to JoseType for at+JWT and respective constant to JoseConstants.

[1] https://github.com/apache/cxf/pull/990/files#diff-1c24cdb27ac335b1f77f921093e723cfeeda77ce8e14d3196d2d1977a3d1effaR648

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @reta, thanks for the review!

According to RFC 9068 sections 2.1 and section 4, a JWT access token must be signed, optionally encrypted. As I interpret the comment, it means the same thing as specs required?

Regarding JoseType and JoseConstants, I will look into them bit more.

gnodet added a commit that referenced this pull request Mar 11, 2026
Per RFC 9068 Section 2.1, JWT access tokens MUST include a typ
header parameter set to "at+jwt". This change:

- Adds TYPE_AT_JWT constant to JoseConstants
- Adds AT_JWT member to JoseType enum with proper lookup
- Sets the at+jwt type on both JWS and JWE headers when producing
  JWT access tokens in AbstractOAuthDataProvider

Closes #990

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet
Copy link
Contributor

gnodet commented Mar 12, 2026

Superseded by #2948 which implements RFC 9068 at+jwt support using the JoseType enum approach as suggested by @reta.

@gnodet gnodet closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants