Skip to content

Bug 2048099 - Return InvalidStateError when excludeCredentials matches a platform credential on macOS.#296

Closed
shetrona wants to merge 1 commit into
mozilla-firefox:mainfrom
shetrona:bug-2048099-excludecredentials-invalidstate
Closed

Bug 2048099 - Return InvalidStateError when excludeCredentials matches a platform credential on macOS.#296
shetrona wants to merge 1 commit into
mozilla-firefox:mainfrom
shetrona:bug-2048099-excludecredentials-invalidstate

Conversation

@shetrona

Copy link
Copy Markdown
Contributor

On macOS 15+, ASAuthorizationErrorMatchedExcludedCredential (code 1006) is returned when a credential in the excludeCredentials list is found on the platform authenticator. This code was not handled in the ASAuthorizationErrorDomain switch in MacOSWebAuthnService.mm, so it fell through to the default NS_ERROR_DOM_NOT_ALLOWED_ERR — surfacing as a NotAllowedError DOMException indistinguishable from a user cancellation.

Per WebAuthn spec §5.1.3 step 20, an excludeCredentials match must return InvalidStateError. Chrome and Safari already conform. The WPT createcredential-excludecredentials.https.html (landed via Bug 1619996) asserts this but is currently SKIP'd in Firefox CI.

Confirmed via MOZ_LOG="macoswebauthnservice:5" on Firefox 151 / macOS 26.5.1: domain 'com.apple.AuthenticationServices.AuthorizationError' code 1006

[Parent 59271: Main Thread]: D/macoswebauthnservice MacOSAuthenticatorRequestDelegate::didCompleteWithAuthorization: got registration
[Parent 59271: Main Thread]: W/macoswebauthnservice MacOSAuthenticatorRequestDelegate::didCompleteWithError: domain 'com.apple.AuthenticationServices.AuthorizationError' code 1006 (The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1006.))

…s a platform credential on macOS.

On macOS 15+, ASAuthorizationErrorMatchedExcludedCredential (code 1006) is returned when a credential in the excludeCredentials list is found on the platform authenticator. This code was not handled in the
ASAuthorizationErrorDomain switch in MacOSWebAuthnService.mm, so it fell through to the default NS_ERROR_DOM_NOT_ALLOWED_ERR — surfacing as a NotAllowedError DOMException indistinguishable from a user cancellation.

Per WebAuthn spec §5.1.3 step 20, an excludeCredentials match must return InvalidStateError. Chrome and Safari already conform. The WPT createcredential-excludecredentials.https.html (landed via Bug 1619996) asserts this but is currently SKIP'd in Firefox CI.

Confirmed via MOZ_LOG="macoswebauthnservice:5" on Firefox 151 / macOS 26.5.1:
domain 'com.apple.AuthenticationServices.AuthorizationError' code 1006

Signed-off-by: Ronak Sheth <shetrona@amazon.com>
@firefoxci-taskcluster

Copy link
Copy Markdown
No Taskcluster jobs started for this pull request

The allowPullRequests configuration for this repository (in .taskcluster.yml on the default branch) does not allow starting tasks for this pull request.

@github-actions

Copy link
Copy Markdown
Contributor

(Automated Close) Please do not file pull requests here, see https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html

@github-actions github-actions Bot closed this Jun 16, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant