import{_ as e,o as a,c as o,R as c}from"./chunks/framework.44fd0451.js";const A=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"guide/q8.md","filePath":"guide/q8.md","lastUpdated":1715651890000}'),s={name:"guide/q8.md"},t=c(`
相较于 Github,Cloudflare Access 对于中国大陆用户更加友好。如您当前使用 Github、Gitlab、Gitee 作为管理员账户登录时遇到问题,您可以考虑切换 Cloudflare Access 作为 OAuth2 提供方
Oauth2:
Admin: 701b9ea6-9f56-48cd-af3e-cbb4bfc1475c
ClientID: 3516291f53eca9b4901a01337e41be7dc52f565c8657d08a3fddb2178d13c5bf
ClientSecret: 0568b67c7b6d0ed51c663e2fe935683007c28f947a27b7bd47a5ad3d8b56fb67
Endpoint: "https://xxxxx.cloudflareaccess.com"
Type: cloudflare
参数 | 获取方式 |
---|---|
Admin | My Team -> Users -> <具体用户> -> User ID |
ClientID/ClientSecret | Access -> Application -> Add an Application -> SaaS -> OIDC |
Endpoint | Access -> Application -> Application URL -> 只保留协议+域名的部分,路径不需要 |
前往 Zero Trust Dashboard: https://one.dash.cloudflare.com
My Team
-> Users
-> <具体用户>
-> 获取 User ID
并保存;Access
-> Application
-> Add an Application
;SaaS
,在 Application
中输入自定义的应用名称(例如 nezha),选择 OIDC
后点击 Add application
;Scopes
选择 openid
, email
, profile
, groups
;Redirect URLs
填写你的 CallBack 地址,例如 https://dashboard.example.com/oauth2/callback
;Client ID
、Client Secret
、Issuer
地址中协议与域名的部分,例如 https://xxxxx.cloudflareaccess.com
/opt/nezha/dashboard/data/config.yaml)
,参考示例配置修改 Oauth2
配置,并重启 Dashboard 服务 在完成 Dashboard 的设置后,您还需要在 Zero Trust Dashboard 中 Access
-> Applications
-> <应用名>
-> Policies
配置验证策略。您可以选择包括邮件OTP验证、硬件密钥验证、等十多种 SSO 验证方式,详细配置请参考 Cloudflare Zero Trust 文档