Technical · Frontend

Apple Domain Verification, Angular 8 and Netlify

October 17, 2019

Some lessons learned when working on a new project with the new Sign-in with Apple service, our Angular 8 solution, and Netlify.

At 3Metas, we are working on a new project that integrates the new Sign with Apple service in apps and websites. There is a couple of things we learned in the process:

Apple requires that you confirm your domain using the standard .well-know folder and dropping there an encrypted file named: apple-developer-domain-association.txt that you will obtain during the service provisioning. This is on the Certificates, Identifiers & Profiles section on the Apple Developer Portal (developer.apple.com)

As we are using Angular 8 to build our site, we created the folder on the src root, and dropped the file there. On angular.json we added this line:

“src/.well-known”

under the assets section.

However, after deployment we found that Apple wasn’t happy at all with the file, even though it was accessible from the suggested URL:

https://yourdomain.com/.well-known/apple-developer-domain-association.txt

After check our custom domain configuration on the Netlify admin panel, we realize that our primary domain is www.ourdomain.com, instead of just domain.com. when a request is directed to domain.com, Netlify will redirect accordingly.

Netlify domain management showing a primary custom domain and its redirect
Netlify Primary Domain Configuration

Apple didn’t like. Redirects are not nice when running security validations. We changed our settings on Apple to let them know that our primary domain includes the www. Validation file was downloaded from apple again after the domain change, published to Netlify and this time it worked just perfect.

Apple Sign in with Apple web authentication configuration with a verified domain
Sign in with Apple — Service Configuration — Domain Validation

Follow us on Twitter, or Linkedin. With love from Boulder, CO.

Originally published on Medium in 3Metas.

Related reading

More in the Digest — a weekly roundup of AI and agents news — or start with AI Strategy.