Unable to verify Salesforce domain with Apple Pay

413 Views Asked by At

Has anyone figured out how to verify a Salesforce domain with Apple Pay?

Basically, Salesforce does provide a way to verify a domain by going to Setup - Domains and clicking Verify. That prompts you to upload the verification file but Salesforce seems to place it under https://your.domain/.well-known/apple-developer-domain-association.txt whereas Apple is looking for it at your.domain/.well-known/apple-developer-merchantid-domain-association.txt (note the extra merchantid- in the file name).

The main issue is that Salesforce's multi tenant platform doesn't allow for direct access to the file that's placed in .well-known directory and there doesn't seem to be any way to control the file name. Is there any alternative way to verify domain ownership in this case?

1

There are 1 best solutions below

1
On

You will have to use salesforce's url rewriter class and redirect the url to visualforce page. Follow the steps:

  1. Add .txt file(provided by apple) to static resource, make sure static resource is public
  2. create a visualforce page that fetches the content from above static resource you can use getContent() method
  3. Have salesforce site, add above created visualforce page into the site.
  4. Add URL rewriter class that you have created earlier for the site.

Now you can click on verfiy button from apple's site.