There does not appear to be any way to use or create iCloud passkeys with a Safari Web Extension, either using the navigator.credentials
API in an extension origin webpage such as the popover, or using the AuthenticationServices
framework in the SafariWebExtensionHandler
.
I've setup an associated domain for my plugin, and I know it works for the host application. But I get errors trying to do so in the web extension target.
createCredentialRegistrationRequests
results in the following error:
Domain=com.apple.AuthenticationServices.AuthorizationError Code=1004 "Application with identifier <ID> is not associated with domain <RPID>
The other problem, assuming the entitlement works correctly for the web extension, is that there is no NSWindow
to use as the presentation target from the SafariWebExtensionHandler.
Trying to use the navigator.credentials.create
JS API (which is the preferred method, frankly, in a web extension) results in the following error:
NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
Chrome has a great solution for this that I believe should be adopted by Safari. If an extension has host permissions for a relying party it wants to claim, or if it has an associated domain entitlement for it, webauthn operations should be allowed.