Deployment Protection
Make a project's deployments private, so only members of your organization can open them after signing in with Ploy.
Deployment Protection
Deployment protection makes a project's deployment URLs private. A visitor has to sign in with a Ploy account that belongs to the project's organization before the deployment serves anything; everyone else gets nothing back.
Choosing what is private
Set it under Project → Settings → Preferences → Deployment Protection. Only organization owners and admins can change it.
| Setting | Production URL and domains | Branch and commit URLs |
|---|---|---|
| Public (default) | public | public |
| Private previews | public | sign-in required |
| Private | sign-in required | sign-in required |
"Production URL and domains" covers the project's production URL
(<project>.<platform domain>), its custom domains and any organization DNS
record routed to it. Branch URLs (<project>---<branch>) and commit URLs
(<project>--<sha>) are previews.
A change applies within about 30 seconds.
Who can sign in
Any member of the organization that owns the project, whatever their role, viewers included. Removing someone from the organization ends their access within a minute, even on a browser that already signed in.
How sign-in works
- A browser that opens a protected page without a session is redirected to the Ploy dashboard. Signing in there is the usual Ploy sign-in.
- Once the dashboard confirms the account belongs to the organization, it sends the browser back with a single-use code that is only valid for that host for two minutes.
- The deployment trades the code for a session, kept for seven days in an
HttpOnlycookie that is bound to that exact host (__Host-ploy-access). Each host signs in on its own.
Requests that are not page navigations (fetch, API clients, curl) get
401 instead of a redirect.
To sign out of one deployment, open /_ploy/access/sign-out on it.
What your code sees
The access cookie is removed before the request reaches your code, and two headers tell it who signed in:
| Header | Value |
|---|---|
Ploy-Access-User-Id | The Ploy user id |
Ploy-Access-User-Email | The Ploy account's email |
Ploy removes these headers from every request it did not authenticate itself, so a visitor or a calling worker can never set them. On a project with protection turned off they are never present; code that relies on them should refuse a request without them.
Internal traffic
Protection only applies to traffic that arrives over a deployment's public URL. Service bindings, crons, queues, timers and workflows reach the deployment inside the platform and are never asked to sign in. A project with Private protection and a service binding from another of your projects is therefore an internal-only service: your other projects call it, and nobody else can.
Service binding calls carry no Ploy-Access-* headers: the call comes from a
worker, not a signed-in person.
How is this guide?
Last updated on