Step 2: Create a Site in Yext Platform

book
Note
If you are using PagesJS version 1.0.0 or higher, refer to the Site-Level Authentication section of the Authentication reference doc for how to associate your auth policy to your site.

Navigate to your Site repository. We imagine that you have your repo ready for deployment. Before you begin, you’ll need to add a sites-config folder to your repo. In this folder, add a file titled auth.json. The file should look like this:

{
  "policyName" : "example-yext-policy"
}

The policy name should be identical to the policy name you configured in step 1.

What if I want to edit my policy?

Authentication policies are immutable, which means they cannot be changed. If you want to make a change you’ll have to make a new policy and re-deploy. While this may be inconvenient in the case where you have made a typo or want to change a password, the benefit is that all deploys (including previous ones) are secured by the policy connected to the deploy at the time and do not run the risk of a changed policy leaking your private site.

At what Site level does the policy apply?

Security is set per deploy. Therefore as long as your deploy is connected to an authentication policy, it will be entirely protected on the staging, preview, and production URLs.

Congratulations! Your site is now linked to Yext Auth. You can test it out by navigating to your Site link in a private window (where you are not already logged in) and notice the Yext login page prior to accessing your site.

Feedback