[
https://issues.apache.org/jira/browse/CAMEL-27723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18152234#comment-18152234
]
Claus Ibsen commented on CAMEL-27723:
-------------------------------------
Merged in https://github.com/apache/camel/pull/31044 as
https://github.com/apache/camel/commit/110bed69d060a6d60306bf8756e69b9f212d6770,
fixed in 4.24.0.
_Claude Code on behalf of Claus Ibsen_
> camel-grpc - JWT tokens have no expiry
> --------------------------------------
>
> Key: CAMEL-27723
> URL: https://issues.apache.org/jira/browse/CAMEL-27723
> Project: Camel
> Issue Type: Improvement
> Components: camel-grpc
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 4.24.0
>
>
> With {{authenticationType=JWT}} the JSON Web Tokens have no expiry.
> * {{JwtHelper.createJwtToken()}} creates the token once, when the producer
> starts, without the {{exp}} (expires at) and {{iat}} (issued at) claims. The
> same token is sent on every call for the life of the producer.
> * The consumer ({{JwtServerInterceptor}}, verifier from {{JwtHelper}} /
> {{JwtServerInterceptor.prepareJwtVerifier}}) requires neither claim, so such
> a token stays valid until {{jwtSecret}} changes.
> * The table in grpc-component.adoc says {{negotiationType}} "NONE or TLS" for
> JWT, but there is no NONE: the values are PLAINTEXT and TLS. With PLAINTEXT
> the token is sent in clear text.
> h3. Proposed change
> * Producer: new option {{jwtTokenLifetime}} (default 1 hour). The producer
> issues tokens with {{iat}} and {{exp}}, and creates a new token shortly
> before the current one expires (lazily, when a call is made). 0 keeps the old
> tokens without expiry.
> * Consumer: new option {{jwtMaxTokenAge}} (default off), which rejects tokens
> whose {{iat}} is older than this age (or that have no {{iat}}). Expired
> tokens (with {{exp}}) are already rejected by java-jwt. Tokens without
> {{exp}} from other clients keep working by default.
> * Docs: PLAINTEXT instead of NONE, and TLS is strongly recommended with JWT.
> _Claude Code on behalf of Claus Ibsen_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)