Hey!
Is it possible to test passkeys against a locally running server in simulator with self-signed certificate? As far as I can tell, the certificate is trusted on the Simulator and Safari has no trouble communicating with the server or fetching the apple-app-site-association file.
The error I'm getting is
ASAuthorizationController credential request failed with error: Error Domain=com.apple.AuthenticationServices.AuthorizationError Code=1004 "(null)"
Error: ["NSLocalizedFailureReason": Application with identifier FAKETEAMID.com.example.apple-samplecode.Shiny is not associated with domain webauthn-api.local]
When running the Shiny example app. There is an apple-app-site-association available in https://webauthn-api.local:7001/.well-known/apple-app-site-association
:
{
"webcredentials": {
"apps": [ "FAKETEAMID.com.example.apple-samplecode.Shiny" ]
}
}
And in the Associated Domains, I've added:
webcredentials:webauthn-api.local:7001?mode=developer
I saw here https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_associated-domains that to use a local server with the apple-app-site-association, one should add ?mode=developer
to the entitlement.
However, looking at the logs for the server, the simulator does not seem to ever attempt fetching /.well-known/apple-app-site-association
file, so the developer mode does not seem to have any effect. Is the developer mode supposed to work with webcredentials
service. Documentation linked above doesn't make any exclusions for that.