[ 
https://issues.apache.org/jira/browse/CAMEL-25022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-25022.
---------------------------------
    Resolution: Fixed

Merged to main for 4.23.0 via https://github.com/apache/camel/pull/26893 
(commit 4121a741397a5538ac37c3430d53e15421513355). Backports to camel-4.22.x 
and camel-4.18.x, with the matching upgrade-guide notes on main, follow as 
described on the PR.

_Claude Code on behalf of davsclaus_

> camel-oauth: honor the JWT nbf (not before) claim when authenticating bearer 
> tokens with the servlet backend
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-25022
>                 URL: https://issues.apache.org/jira/browse/CAMEL-25022
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-oauth
>            Reporter: Andrea Cosentino
>            Assignee: Andrea Cosentino
>            Priority: Major
>             Fix For: 4.23.0
>
>
> When {{OAuthBearerTokenProcessor}} authenticates an access token through the 
> Jakarta servlet backend ({{ServletOAuth}}), {{UserProfile}} validates the JWS 
> signature and the issuer, and {{UserProfile.expired()}} evaluates the {{exp}} 
> claim. The {{nbf}} (not before) claim is copied into the profile attributes 
> but is never evaluated. RFC 7519 section 4.1.5 specifies that a JWT must not 
> be accepted for processing before its {{nbf}} time.
> The other token validation paths of the module already evaluate {{nbf}}: the 
> Vert.x backend ({{VertxOAuth}}, through Vert.x {{User.expired(leeway)}}) and 
> the {{OAuthTokenValidationFactory}} SPI ({{JwtTokenValidator}}).
> Proposed change:
> * In {{UserProfile}}, reject a token whose {{nbf}} is later than the current 
> time plus the leeway configured in {{JWTOptions}} ({{getLeeway()}}, default 
> 0, the same default as the Vert.x backend and the SPI {{clock-skew-seconds}} 
> option).
> * Add unit tests for a token with a future {{nbf}}, a past {{nbf}}, and an 
> {{nbf}} within the leeway.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to