Skip to content
代码片段 群组 项目
未验证 提交 864ccc0d 编辑于 作者: Naman Jagdish Gala's avatar Naman Jagdish Gala 提交者: GitLab
浏览文件

Docs: Programmatic access to private pages

上级 c3c085f9
No related branches found
No related tags found
2 合并请求!3031Merge per-main-jh to main-jh by luzhiyuan,!3030Merge per-main-jh to main-jh
......@@ -76,6 +76,32 @@ To do this:
GitLab Pages uses a cache for efficiency. Changes to access settings typically take effect within one minute when the cache updates.
## Authenticate with an access token
{{< history >}}
- [Introduced](https://gitlab.com/gitlab-org/gitlab-pages/-/issues/388) in GitLab 17.10.
{{< /history >}}
To authenticate against a restricted GitLab Pages site, you can provide the `Authorization` header with an access token.
Prerequisites:
- You must have one of the following access tokens with the `read_api` scope:
- [Personal access token](../../profile/personal_access_tokens.md#create-a-personal-access-token)
- [Project access token](../settings/project_access_tokens.md#create-a-project-access-token)
- [Group access token](../../group/settings/group_access_tokens.md#create-a-group-access-token)
- [OAuth 2.0 token](../../../api/oauth2.md)
For example, to use an access token with OAuth-compliant headers:
```shell
curl --header "Authorization: Bearer <your_access_token>" <published_pages_url>
```
For invalid or unauthorized access tokens, returns [`404`](../../../api/rest/troubleshooting.md#status-codes).
## Terminating a Pages session
To sign out of your GitLab Pages website, revoke the application access token
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册