Engineering
13 Dec 2024
Implementing Apple’s User-Driven Enrollment on a Website Hosted with Framer
If you’re trying to implement Apple’s User-Driven Enrollment for mobile device management (MDM) and your website is hosted on Framer, you might run into an unexpected challenge. Apple requires a specific verification file to be hosted in a .well-known directory, but Framer’s file upload system can trip you up if you’re not careful.
This guide will walk you through the problem and how to solve it, step by step.
The Challenge: Hosting Apple’s Verification File
According to Apple’s documentation, you need to upload a file named com.apple.remotemanagement to the .well-known directory of your website. This file is critical for Apple to verify your domain as part of the MDM enrollment process.
The problem? Framer recently added support for .well-known directories (🎉), but their file upload system doesn’t play nice with Apple’s requirements.
The Gotcha
Framer mistakenly interprets the .remotemanagement part of the filename as a file extension and rejects it, believing it to be invalid. As a result, you can’t directly upload a file named com.apple.remotemanagement to your .well-known directory.
The Solution: A Simple Workaround
Here’s how you can work around this limitation:
Step 1: Rename the File with a .json Extension
Framer does accept files with a .json extension. So, instead of trying to upload com.apple.remotemanagement, rename the file to com.apple.remotemanagement.json.
For example:
• Original filename: com.apple.remotemanagement
• Renamed filename: com.apple.remotemanagement.json
Step 2: Upload the File to the .well-known Directory
1. In your Framer project, navigate to the Settings panel.
2. Locate the .well-known file upload section.
3. Upload your renamed file, com.apple.remotemanagement.json.
Step 3: Set Up a Redirect in Framer
Since Apple expects the file to be available at https://yourdomain.com/.well-known/com.apple.remotemanagement (without the .jsonextension), you need to set up a redirect.
Here’s how to do that:
1. In Framer, go to the Redirects section under the project’s Settings.
2. Add a new redirect rule:
• From: / .well-known/com.apple.remotemanagement
• To: / .well-known/com.apple.remotemanagement.json
• Type: 301 Permanent
Step 4: Test Your Setup
Once the file is uploaded and the redirect is in place:
1. Open a browser and navigate to https://yourdomain.com/.well-known/com.apple.remotemanagement.
2. Verify that the file is accessible and returns the correct content.
3. Use Apple’s verification process to confirm that your domain is set up correctly.
Why This Matters
Framer’s .well-known file support is a welcome addition, but small quirks like this can be frustrating. By following this guide, you can implement Apple’s User-Driven Enrollment without getting bogged down by technical hiccups.
Have other tips for working with .well-known files on Framer? Share them in the comments!