Set outgoing JWT expiration to 5 minutes to match other SDKs - #66
Merged
Conversation
The Java SDK signed its authorization-request and client-assertion JWTs with a 1-hour expiration, while every other Duo Universal Prompt SDK (C#, Go, Node.js, PHP, Python) uses a 5-minute expiration. Python additionally caps the configurable value at 5 minutes and rejects anything longer. This aligns Java with the rest of the SDK family by changing the expiration from 3600000 ms (1 hour) to 300000 ms (5 minutes), reducing the validity window of these short-lived tokens by 12x. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
scweber-cisco
approved these changes
Aug 25, 2026
AaronAtDuo
enabled auto-merge (squash)
August 25, 2026 14:42
jeffreyparker
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Java SDK signs its outgoing JWTs (the authorization-request JWT in
createJwtForAuthUrland the client-assertion JWT increateJwt) with a 1-hour expiration. Every other Duo Universal Prompt SDK uses a 5-minute expiration:Utils.javaONE_HOUR_IN_MILLISECONDS = 3600000JwtUtils.csAddMinutes(FIVE_MINUTES)client.goconst expirationTime = 300constants.tsJWT_EXPIRATION = 300Client.phpJWT_EXPIRATION = 300client.pyFIVE_MINUTES_IN_SECONDSThis change brings Java in line with the rest of the SDK family by changing the expiration from
3600000ms (1 hour) to300000ms (5 minutes), shrinking the validity window of these short-lived tokens by 12x.Changes
ONE_HOUR_IN_MILLISECONDS→FIVE_MINUTES_IN_MILLISECONDSand set it to300000. Applies to bothcreateJwtandcreateJwtForAuthUrl.Testing
mvn test— all 53 tests pass.mvn checkstyle:check— 0 violations.No existing test asserts on the outgoing JWT's
expvalue, so no test changes were needed.This PR description was generated with AI assistance (Claude).
🤖 Generated with Claude Code