ASAuthorizationController fails with error 1004 when wildcard for applinks is used

Hey, I'm looking for some help with ASAuthorizationController and passkeys. It seems that wildcards in applinks for subdomains break passkeys for the main domain.

The app has the following entries in entitlements:

webcredentials: mydomain.com
applinks: mydomain.com
applinks: *.mydomain.com

mydomain.com is a placeholder for the actual domain

The AASA file is hosted only at mydomain.com and contains a correctly formatted "webcredentials" entry.

{
	"webcredentials": {
		"apps": [
			"app-id-corretly-formatted"
		]
	},
	"applinks": {
		"apps": [],
		"details": [
			// ...			
		]
	}
}

When I use ASAuthorizationController with the domain mydomain.com, it reports the following error:

Error Domain=com.apple.AuthenticationServices.AuthorizationError Code=1004
"Application with identifier X is not associated with domain mydomain.com"
UserInfo={NSLocalizedFailureReason=Application with identifier
X is not associated with domain mydomain.com

If I remove the following line from the entitlements "applinks: *.mydomain.com", it works as expected:

webcredentials: mydomain.com
applinks: mydomain.com

It appears that the problem is with the wildcard in the subdomains. Has someone experienced this issue?

Post not yet marked as solved Up vote post of kean1990 Down vote post of kean1990
816 views

Replies

That definitely sounds unexpected. Can you please reproduce the issue and then file this through Feedback Assistant? The logs will help us determine what's going wrong :)

Hey, @garrett-davidson. It does! Multiple people spent hours on this, and the only thing that seems to work is the removal of "applinks: *.mydomain.com". But that's not a workable solution for us because it'll break the universal links for the customers :(

I reproduced the issue and attached to the feedback I opened earlier: FB13305602. I'll be happy to help provide any details you might need.

Update: we have a potential workaround. Adding "webcredentials: *.mydomain.com" seems to fix it.