---
title: "Password protection"
url: https://docs.corefinity.com/guides/sites/access-and-security/password-protection
type: guide
last_updated: 2026-11-13
feature: http-auth
related:
  - https://docs.corefinity.com/api/reference/access/reveal-site-preview-login.md
  - https://docs.corefinity.com/api/reference/access/get-site-http-auth.md
  - https://docs.corefinity.com/api/reference/access/replace-site-http-auth.md
  - https://docs.corefinity.com/api/reference/access/reveal-site-http-auth-password.md
  - https://docs.corefinity.com/mcp/tools/corestack_http_auth_get.md
  - https://docs.corefinity.com/mcp/tools/corestack_http_auth_update.md
  - https://docs.corefinity.com/mcp/tools/corestack_http_auth_reveal_password.md
---
# Password protection

Put a browser login in front of an environment, or in front of one path such as the admin area.

## Before you start

- You can open the site in **Managed Websites**. Anyone who can open a site can change its password protection.
- Each environment has its own protection: choose **Production** or **Staging** in the site header first. Production starts open; staging environments start protected.
- Addresses with **Website** access on the environment's [firewall](/guides/sites/access-and-security/firewall) are never asked for the login.

## Protect the whole environment

1. **Open Password protection**

   Go to **Managed Websites**, choose the site, then **Password protection** under **Access & security**. Choose **Turn on**.

   _Screenshot: A site page with Password protection ringed in the menu. The Password protection card reads Off, No login is asked for, with the Turn on button ringed._

2. **Set the first login**

   Under **Users**, enter a **Username**. Leave **Password** on **Generate**, or choose **Set** and enter one.

   _Screenshot: The Protect the whole environment dialog: the path / for the whole environment, one user with a username and the password choices Generate and Set, and the buttons Cancel and Turn on._

3. **Turn it on**

   Choose **Turn on**. A generated password is shown once: copy it, then choose **Done**.

The login is asked for after about a minute. The card then shows the **Username** and the hidden **Password**: **Reveal** shows it, and every reveal is logged.

_Screenshot: The Password protection card switched on, with the switch ringed: the username harbour-preview, the password hidden behind dots with Reveal and Copy, a line saying how many firewall addresses skip the prompt, and the Advanced section closed._

> **Note:** On Production, pages a CDN or a visitor's browser cached before you turned protection on stay visible to them until that cache expires.

## Protect one path

1. **Add a rule**

   Open **Advanced** and choose **Add rule**. Enter a **Path prefix**, or choose **Admin area** for the platform's admin paths.

   _Screenshot: The Add rule dialog: the Admin area shortcut for /wp-admin/ and /wp-login.php, the Path prefix field, one user with a username and password, the Enabled tick, and the buttons Cancel and Add rule._

2. **Add its users and save**

   Enter a **Username** for each person, choose **Add rule**, then **Save changes** on the card. Path rules are a draft until you save them, and apply about ten seconds later.

## Change logins or turn protection off

Open **Advanced**. Each rule's row has **Add user**, **Edit** and **Remove**, and each user has **Set new password…** and **Remove**.

_Screenshot: The Advanced section open: the rule / Whole environment, then the path rules /wp-admin/, On, and /press-kit/, Off, each with its users, a switch and the buttons Add user, Edit and Remove, and Add rule below\._

To stop asking for a login, turn off the switch at the top of the card. The whole-environment rule keeps its users while it is off.

## Automate this

**API:** [Replace a site's HTTP authentication](https://docs.corefinity.com/api/reference/access/replace-site-http-auth.md), scope `write`

```bash
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/http-auth \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": false,
    "rules": [
      {
        "enabled": true,
        "path_prefix": "/wp-admin/",
        "users": [
          {
            "password": "Example-editor-2026",
            "username": "editor"
          }
        ]
      }
    ],
    "version": 0
  }'
```

**MCP:** [`corestack_http_auth_update`](https://docs.corefinity.com/mcp/tools/corestack_http_auth_update.md), scope `write`

```json
{
  "name": "corestack_http_auth_update",
  "arguments": {
    "site_id": 4211,
    "version": 3,
    "rules": [
      {
        "path_prefix": null,
        "enabled": true,
        "users": [
          {
            "username": "client",
            "generate": true
          }
        ]
      }
    ]
  }
}
```

**Control Panel:** Managed Websites › your site › Access & security › Password protection ([https://manage.corefinity.com/go/http-auth](https://manage.corefinity.com/go/http-auth))

## Related

- [Firewall](/guides/sites/access-and-security/firewall): Allow an IP address to reach a site.
- [Create an environment](/guides/sites/environments-and-copies/create-an-environment): Add, rename or delete a staging environment.
- [Hide from search engines](/guides/sites/go-live/hide-from-search-engines): Ask search engines not to index a site.
