Repository navigation
Conversation
MFA Enroll now covers the webauthn factor type: the enrollment ceremony is the only flow that sends a create credential, and a failed ceremony leaves the factor for the app to unenroll. The new MFA Verify spec says how the webauthn body is built, and that the step-up ceremony refuses a create challenge before it starts the authenticator.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
grdsdev
added a commit
to supabase/supabase-swift
that referenced
this pull request
Nov 3, 2026
When the challenge asks for a create ceremony, verifyWebAuthn throws AuthError of kind mfaFactorNotVerified before it shows the passkey sheet. Only enrollWebAuthn registers a credential. This follows supabase/sdk#319.
grdsdev
added a commit
to supabase/supabase-swift
that referenced
this pull request
Nov 3, 2026
…1680) * feat(auth)!: regroup passkeys under client.passkeys and client.mfa Move the experimental passkey API to `auth.passkeys` (signIn, register, list, rename, delete, and the low-level options/verify calls) and the admin calls to `auth.admin.passkeys`. MFA keeps `enrollWebAuthn` and `verifyWebAuthn`. Challenge IDs are `UUID`, the anchor is optional and defaults to the app's key window, a dismissed sheet throws `CancellationError`, and other authenticator errors throw `AuthError` of kind `passkeyCeremonyFailed`. All of it stays `@_spi(Experimental)`. Fix the MFA WebAuthn flow against the auth server: - read the options from the `credential_options.publicKey` wrapper - send `webauthn: {type, credential_response}` on verify - always send a JSON body on challenge - run the ceremony the challenge asks for (`create` or `request`) - unenroll the new factor when enrollment fails, so a retry is not blocked by a name conflict BREAKING CHANGE: the experimental passkey and WebAuthn MFA methods moved and were renamed. See docs/migrations/v3/Auth.md. Fixes SDK-2073 * test(auth): keep the unenroll mock callback off the main actor The `@MainActor` test's `requestCallback` closure inherited main-actor isolation, and Mocker runs it on the URL loading thread, so xcodebuild's isolation check trapped. Also register `MFAVerifyParams.encode` in sdk-compliance.yaml and use the result of `verifyWebAuthn` in a test. * fix(auth): stop unenrolling the WebAuthn factor after a failed enrollment The leftover unverified factor is server behavior (AUTH-2001), so the SDK no longer works around it. The docs tell apps how to find and remove the factor. * docs(auth): find a leftover WebAuthn factor through user(jwt:) * feat(auth)!: verifyWebAuthn only steps up with a verified factor When the challenge asks for a create ceremony, verifyWebAuthn throws AuthError of kind mfaFactorNotVerified before it shows the passkey sheet. Only enrollWebAuthn registers a credential. This follows supabase/sdk#319. * test(auth): call session() in the passkey registration integration test
This branch has not been deployed
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.
What
specs/auth/mfa/enroll.md: adds thewebauthnfactor type. The enrollment ceremony is enroll → challenge →navigator.credentials.create→ verify withtype: create. It is the only flow that sends acreatecredential. When the ceremony or the verify fails, the SDK does not unenroll the factor. Its docs tell the app how to find the factor and remove it.specs/auth/mfa/verify.md(new):webauthnbody keeps the W3C keys unchanged.typecomes from the challenge response.createchallenge, it raises the SDK's own error before it starts the authenticator.capabilities/auth.yaml: theauth.mfa.enrolldescription now lists WebAuthn.Why
typethat the client sends (verifyWebAuthnFactor). If a method that is meant to step up sendscreate, it can register a credential without warning. With the step-up rule, a step-up call never registers one.mfa_factor_name_conflict. Linear AUTH-2001 tracks the server fix. SDKs do not unenroll the factor on their own, because an automatic unenroll can remove a concurrent enrollment (Linear SDK-1716).supabase/supabase-swift#1680 implements both rules.
Checks
bun run validate,bun run format-and-lint, andbun testpass.