doc/user/project/pages/pages_access_control.md
{{< details >}}
{{< /details >}}
{{< history >}}
ff_oauth_redirect_to_sso_login. Disabled by default.ff_oauth_redirect_to_sso_login removed.{{< /history >}}
You can enable Pages access control on your project if your administrator has enabled the access control feature on your GitLab instance. When enabled, only authenticated members of your project (at least Guest) can access your website, by default:
<i class="fa-youtube-play" aria-hidden="true"></i> For a demonstration, see Pages access controls.
In the top bar, select Search or go to and find your project.
In the left sidebar, select Settings > General.
Expand Visibility, project features, permissions.
To enable the access control, toggle Pages. If you don't see the toggle button, that means it isn't enabled. Ask your administrator to enable it.
The Pages access control dropdown list allows you to set who can view pages hosted with GitLab Pages, depending on your project's visibility:
Select Save changes. Your changes may not take effect immediately. GitLab Pages uses a caching mechanism for efficiency. Your changes may not take effect until that cache is invalidated, which usually takes less than a minute.
The next time someone tries to access your website and the access control is enabled, they're presented with a page to sign in to GitLab and verify they can access the website.
When SAML SSO is configured for the associated group and the access control is enabled, users must authenticate using SSO before accessing the website.
When public access is disabled at the instance or group level, projects lose the Everyone visibility level option and are restricted to project members or everyone with access, depending on the project's visibility setting.
{{< history >}}
{{< /history >}}
Configure a setting for the group to remove the public visibility option for Pages. When enabled, all projects in the group and its subgroups lose the option to use the "Everyone" visibility level and are restricted to project members or everyone with access, depending on the project's visibility setting.
Prerequisites
To do this:
GitLab Pages uses a cache for efficiency. Changes to access settings typically take effect in one minute when the cache updates.
{{< history >}}
{{< /history >}}
To authenticate against a restricted GitLab Pages site, you can provide the Authorization header with an access token.
Prerequisites:
read_api scope:
For example, to use an access token with OAuth-compliant headers:
curl --header "Authorization: Bearer <your_access_token>" <published_pages_url>
For invalid or unauthorized access tokens, returns 404.
To sign out of your GitLab Pages website, revoke the application access token for GitLab Pages: