Skip to content

feat: support dest_app_name, dest_app_id, and display_username - #42

Merged
AaronAtDuo merged 1 commit into
duosecurity:mainfrom
scweber-cisco:add-dest-app-and-display-username
Sep 3, 2026
Merged

feat: support dest_app_name, dest_app_id, and display_username#42
AaronAtDuo merged 1 commit into
duosecurity:mainfrom
scweber-cisco:add-dest-app-and-display-username

Conversation

@scweber-cisco

@scweber-cisco scweber-cisco commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

The OIDC Auth API documents three optional claims in the authorization request JWT that create_auth_url had no way to send:

  • dest_app_name — user-facing application name, shown in Duo Mobile and surfaced as destination_name in the authentication log
  • dest_app_id — long-lived unique application identifier, not shown to users
  • display_username — username shown in the Duo Mobile "user" field for Push; defaults to the Duo username when omitted

All three are optional keyword arguments and are only added to the JWT when provided, so existing callers are unaffected:

create_auth_url(username, state, nonce=None, dest_app_name=None,
                dest_app_id=None, display_username=None)

Test plan

Three new cases in tests/test_create_auth.py, each asserting the exact encoded request JWT:

  • both dest_app_name and dest_app_id
  • display_username alone
  • dest_app_name alone

The two pre-existing tests assert the full expected JWT payload, so they already guard against the new claims appearing when unset.

Full suite passes (80 tests) and flake8 is clean.

Also manually tested with the demo app. Passing dest_app_name to create_auth_url resulted in same value being echoed back in the auth response.

🤖 Generated with Claude Code

The OIDC Auth API accepts three optional claims in the authorization
request JWT that create_auth_url had no way to send:

- dest_app_name: user-facing application name, shown in Duo Mobile and
  the authentication log
- dest_app_id: long-lived unique application identifier, not shown to
  users
- display_username: username shown in the Duo Mobile "user" field for
  Push, defaulting to the Duo username when omitted

All three are optional keyword arguments and are only added to the JWT
when provided, so existing callers are unaffected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@scweber-cisco
scweber-cisco marked this pull request as ready for review September 2, 2026 20:13
@AaronAtDuo
AaronAtDuo merged commit e87016b into duosecurity:main Sep 3, 2026
5 checks passed
@scweber-cisco scweber-cisco changed the title Support dest_app_name, dest_app_id, and display_username in create_auth_url Support dest_app_name, dest_app_id, display_username, max_age, and prompt in create_auth_url Sep 4, 2026
@scweber-cisco scweber-cisco changed the title Support dest_app_name, dest_app_id, display_username, max_age, and prompt in create_auth_url feat: support dest_app_name, dest_app_id, and display_username Sep 4, 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.

2 participants