Skip to content

Added dpop support for myaccount and passkeys#137

Merged
rmad17 merged 1 commit into
myaccount-supportfrom
dpop-support
Jul 21, 2026
Merged

Added dpop support for myaccount and passkeys#137
rmad17 merged 1 commit into
myaccount-supportfrom
dpop-support

Conversation

@rmad17

@rmad17 rmad17 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

📋 Changes

This PR carves the DPoP slice out of #116, which combined Passkey, My Account, and DPoP into one large diff. It's the third and final of three sequential branches (Passkey → My Account → DPoP), split for merge-conflict legibility — each lands as its own PR instead of one large here was reviewed there; this PR only re-sequences it.

Features

  • DPoP (RFC 9449) sender-constrained tokens: new DPoPAuth auth scheme (auth_schemes/dpop_auth.py). Binds a token to an EC P-256 key your server holds, so a stolen token alone cannot be replayed.
  • Opt-in on Passkey sign-in and MyAccount: every passkey and My Account method now takes an optional dpop_key. Omitting it preserves today's Bearer-token behavior with no change; supplying it attaches a DPoP proof to the request (signin_with_passkey, mfa.verify, and all seven MyAccountClient authentication-methods/factors methods).
  • Nonce-challenge handling (RFC 9449 §8.2): when Auth0 responds with use_dpop_nonce and a DPoP-Nonce header, the SDK transparently rebuilds the proof with the nonce and retries once — the caller never sees the challenge.
  • Bearer-downgrade rejection: if dpop_key is supplied but the server returns an unbound (Bearer) token, or vice versa, the SDK raises rather than silently accepting a token whose binding doesn't match what was requested — on signin_with_passkey (PasskeyError) and mfa.verify(MfaVerifyError).

API Changes

  • New public auth scheme: DPoPAuth, exported from auth_schemes.
  • New optional dpop_key: Optional[jwk.JWK] parameter on: ServerClient.signin_with_passkey, MfaClient.verify, and
    MyAccountClient.get_factors, list_authentication_methods, get_authentication_method, delete_authentication_method, update_authentication_method, enroll_authentication_method,
    verify_authentication_method.
  • No new error types — DPoP-binding failures raise the existing PasskeyError / MfaVerifyError for the affected call.
  • Docs: README gains a DPoP section; Passkeys.md gains "DPoP-bound passkey tokens"; MyAccountAuthenticationMethods.md gains a "DPoP" section; MFA.md gains "Verify with DPoP" for step-up.

@rmad17
rmad17 requested a review from a team as a code owner July 20, 2026 13:45
@rmad17
rmad17 requested a review from kishore7snehil July 20, 2026 14:07

@kishore7snehil kishore7snehil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rmad17
rmad17 merged commit c867576 into myaccount-support Jul 21, 2026
7 checks passed
@rmad17
rmad17 deleted the dpop-support branch July 21, 2026 08:51
@rmad17 rmad17 mentioned this pull request Jul 21, 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