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

**Change HTTP authentication.** Replace a row's HTTP authentication set at its version: the whole-environment switch and the protected paths with their logins. A login's password is either one you send or one the control panel generates (generate: true), which opens in the person's browser. Scope: write. Also needs exec when reveal_to_agent is true. Long-running: answers with a task. The secret opens in the person's browser; set reveal_to_agent to true to receive it yourself (needs exec).

- Scope: `write`
- Also needs `exec` when the set or generated passwords
- Runs as a task: yes
- Returns a secret only when `reveal_to_agent` is set

## When to use it

Replace a row's HTTP authentication set at its version: the whole-environment switch and the protected paths with their logins. A login's password is either one you send or one the Control Panel generates (generate: true), which opens in the person's browser.

## Inputs

- `site_id` (integer, ≥ 1, required)
- `version` (integer, ≥ 0, required): The set's version from corestack_http_auth_get.
- `enabled` (boolean): The whole-environment rule's switch.
- `rules` (array of objects, up to 20 items, required)
  - `id` (integer, or null, ≥ 1): An existing rule's id; leave it out for a new rule.
  - `path_prefix` (string, or null, up to 200 characters, required): null for the whole environment (at most once), else a path such as /admin.
  - `enabled` (boolean, required)
  - `users` (array of objects, up to 10 items, required)
    - `id` (integer, or null, ≥ 1): An existing login's id; leave it out for a new login.
    - `username` (string, 3–32 characters, required)
    - `password` (string, 12–72 characters): 12–72 characters with a letter and a digit; or send generate: true.
    - `generate` (boolean): Let the Control Panel generate the password (shown in the person's browser).
- `reveal_to_agent` (boolean, default `false`): Return the secret to you instead of opening it in the person's browser. Needs exec.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "enabled": {
      "description": "The whole-environment rule's switch.",
      "type": "boolean"
    },
    "reveal_to_agent": {
      "default": false,
      "description": "Return the secret to you instead of opening it in the person's browser. Needs exec.",
      "type": "boolean"
    },
    "rules": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "id": {
            "description": "An existing rule's id; leave it out for a new rule.",
            "minimum": 1,
            "type": [
              "integer",
              "null"
            ]
          },
          "path_prefix": {
            "description": "null for the whole environment (at most once), else a path such as /admin.",
            "maxLength": 200,
            "type": [
              "string",
              "null"
            ]
          },
          "users": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "generate": {
                  "description": "Let the control panel generate the password (shown in the person's browser).",
                  "type": "boolean"
                },
                "id": {
                  "description": "An existing login's id; leave it out for a new login.",
                  "minimum": 1,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "password": {
                  "description": "12–72 characters with a letter and a digit; or send generate: true.",
                  "maxLength": 72,
                  "minLength": 12,
                  "type": "string"
                },
                "username": {
                  "maxLength": 32,
                  "minLength": 3,
                  "type": "string"
                }
              },
              "required": [
                "username"
              ],
              "type": "object"
            },
            "maxItems": 10,
            "type": "array"
          }
        },
        "required": [
          "path_prefix",
          "enabled",
          "users"
        ],
        "type": "object"
      },
      "maxItems": 20,
      "type": "array"
    },
    "site_id": {
      "minimum": 1,
      "type": "integer"
    },
    "version": {
      "description": "The set's version from corestack_http_auth_get.",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "site_id",
    "version",
    "rules"
  ],
  "type": "object"
}
```

## Refusals

- `deleted`: the site is deleted (in its grace period); restore it with corestack_site_restore_deleted first.
- `provisioning`: the site is still being created; wait for corestack_site_provisioning_get to finish.
- `stale`: the object changed since you read it; read it again and call with the new version.
- `managed_elsewhere` (message: "This site is managed by another control panel"): another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

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

## Prompt

```text
Using the Corefinity MCP server, call corestack_http_auth_update with site_id 4211, version 3, rules [{"path_prefix":null,"enabled":true,"users":[{"username":"client","generate":true}]}]. (Change HTTP authentication.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [PUT /api/corestack/sites/{site}/http-auth](https://docs.corefinity.com/api/reference/access/replace-site-http-auth.md)
- Guide: [Password protection](https://docs.corefinity.com/guides/sites/access-and-security/password-protection.md)
