feat: passkey support#135
Merged
Merged
Conversation
…Ks state handling
Added dpop support for myaccount and passkeys
feat: myaccount API support
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.
This PR carves the Passkey-only slice out of #116 , which combined Passkey, My Account, and DPoP into one large diff. It's the first of three sequential branches (Passkey → My Account → DPoP), split for merge-conflict legibility — each lands as its own PR instead of one large one.
Refer to #116 for the original review discussion and feedback — the code here was reviewed there; this PR only re-sequences it.
Features
ServerClient):passkey_signup_challenge,passkey_login_challenge, andsignin_with_passkey. Callpasskey_signup_challengeorpasskey_login_challengeto get anauth_sessionand WebAuthn options for the browser, then callsignin_with_passkeywith the signed credential to complete sign-in andcreate a session. Uses the
urn:okta:params:oauth:grant-type:webauthngrant.
signin_with_passkeyraisesMfaRequiredErrorwhen a second factor is required, before any sessionis created (persist=False path).
get_token_by_refresh_tokennow raisesthe same typed
MfaRequiredErrorvia a sharedMfaClient._raise_mfa_requiredhelper, instead of stuffing
mfa_token/mfa_requirementsonto anApiError.MfaClientinternals hardened alongside this: public MFA methods(
list_authenticators,enroll_authenticator,challenge_authenticator,verify) now decrypt an encryptedmfa_tokeninternally instead ofrequiring the caller to pass a raw token; error-body parsing now falls
back safely on non-JSON responses instead of raising a raw JSON-decode
error.
API Changes
ServerClient.passkey_signup_challenge,passkey_login_challenge,signin_with_passkey.PasskeyUserProfile,PasskeySignupChallengeResponse,PasskeyLoginChallengeResponse,PasskeyAuthResponse,PasskeyTokenResponse,PasskeyLoginResult, plus supporting WebAuthnoption models (
PasskeyRpInfo,PasskeyUserInfo,PasskeyPubKeyCredParam,PasskeyAuthenticatorSelection,PasskeyPublicKeyOptions).PasskeyError,PasskeyErrorCode. Raised by the threeServerClientpasskey methods.AuthenticatorResponse.authenticator_typeandChallengeResponse.challenge_typeare now typed
str(previously aLiteral), so a factor/challenge typeAuth0 adds later doesn't raise a
ValidationError. No change to valuesreturned today.
Deprecation
Deprecation (non-breaking): the
AuthenticatorTypealias still importsand resolves to its previous
Literal["otp", "oob", "recovery-code"], butnow emits a
DeprecationWarningon access and is scheduled for removal ina future major release. It no longer constrains a model field. Existing
imports keep working.