Add Basic Authentication

April 3, 2026

Add Basic Authentication

Adds Basic Authentication protection to an existing environment. Commonly used after provisioning to restrict access with a shared login and password.

Endpoint

POST <CLOUD_URL>/modules/cloudAction/addBasicAuthent.do

Example

CLOUD_URL="https://jahia.cloud" # Base URL of your Jahia Cloud instance
CLOUD_ENVNAME="my-env" # Must be unique across your organization, and can only contain lowercase letters, numbers and hyphens
CLOUD_ORG="jahiacloud" # Assigned to your organization by Jahia, used to construct the shortDomain
CLOUD_SHORTDOMAIN="${CLOUD_ENVNAME}-${CLOUD_ORG}" # Short domain for the new environment

APP_ID=123 # The targetAppid of the environment, retrieved from the getContext endpoint.

BASICAUTH_USERNAME="joe" # Username for the Basic Auth prompt
BASICAUTH_PASSWORD="AnotherSuperSecuredPassword1234" # Password for the Basic Auth prompt

CLOUD_PAT="PRIVATE_TOKEN" # Cloud Perstonal API Token generated from the Jahia Cloud UI.

curl -i "${CLOUD_URL}/modules/cloudAction/addBasicAuthent.do" \
  -X POST \
  -H "Authorization: APIToken ${CLOUD_PAT}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" \
  --data-raw "orgName=${CLOUD_ORG}&shortDomain=${CLOUD_SHORTDOMAIN}&login=${BASICAUTH_USERNAME}&password=${BASICAUTH_PASSWORD}&targetAppid=${APP_ID}"

Expected result

HTTP 200 on success. Basic Authentication is applied immediately.