feat: support max_age and prompt in create_auth_url - #43
Open
scweber-cisco wants to merge 1 commit into
Open
Conversation
Two more optional authorization request JWT claims that had no SDK support: - max_age: maximum seconds since the user's last interactive authentication; an older remembered session forces interactive reauth - prompt: set to 'login' to force interactive reauthentication despite a remembered session max_age is compared against None rather than checked for truthiness so that a max_age of zero reaches Duo, since zero always forces interactive reauthentication rather than meaning "unset". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
scweber-cisco
marked this pull request as ready for review
September 4, 2026 18:14
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 OIDC Auth API documents two optional claims in the authorization request JWT that
create_auth_urlhas no way to send:max_age— maximum number of seconds since the user last authenticated interactively. A remembered session older than this forces interactive reauthentication.prompt— set tologinto force interactive reauthentication even when the user has a remembered session.Both are optional keyword arguments and are only added to the JWT when provided, so existing callers are unaffected:
Test plan
Three new cases in
tests/test_create_auth.py, each asserting the exact encoded request JWT:max_agemax_age=0, guarding a truthiness pitfallprompt='login'The pre-existing tests assert the full expected JWT payload, so they already guard against the new claims appearing when unset.
Full suite passes (83 tests) and
flake8is clean.🤖 Generated with Claude Code