上面什么都没有了,往下看吧
Powered by Randall
全部文档 全部文档 / 账号
用 RandallFlare 登录(OAuth 与 OpenID Connect) randallflare.com 是 OAuth 2.1 和 OpenID Connect 提供方:应用、MCP 客户端和 agent 可以获取访问你的账号、你的应用和人机验证的令牌。
在控制台打开 任何应用都可以向 RandallFlare 用户请求授权并获得令牌:通过 API 读写他们的资源、打开他们的私有应用,或者只是知道他们是谁(OpenID Connect)。Claude、Cursor 这样的 MCP 客户端在遇到 RandallFlare 上的私有 MCP 服务器时会自动走这个流程。发现文档位于 /.well-known/oauth-authorization-server、/.well-known/openid-configuration 和 /.well-known/jwks.json。
bash
# 1. Register once (or use a client you created under Account → Connected apps)
curl -s https://randallflare.com/oauth/register -H 'content-type: application/json' \
-d '{"client_name":"My agent","redirect_uris":["http://127.0.0.1:8765/cb"]}'
# → { "client_id": "…", "token_endpoint_auth_method": "none", … }
# 2. Send the user to consent (PKCE: S256 of a 43-128 char verifier)
https://randallflare.com/oauth/authorize?response_type=code&client_id=…&redirect_uri=http://127.0.0.1:8765/cb
&scope=openid%20profile%20read%20write%20offline_access&code_challenge=…&code_challenge_method=S256&state=…
# 3. Exchange the code
curl -s https://randallflare.com/oauth/token -d grant_type=authorization_code -d client_id=… \
-d code=… -d redirect_uri=http://127.0.0.1:8765/cb -d code_verifier=…
# → { "access_token": "eyJ…", "refresh_token": "…", "id_token": "eyJ…", "expires_in": 3600 }
# 4. Call the API or the MCP server with it
curl -s https://randallflare.com/api/edge/v1/whoami -H 'authorization: Bearer eyJ…'
必须使用带 PKCE(S256)的授权码流程;公共客户端没有密钥。刷新令牌会轮换;重用旧令牌会吊销整个家族。
作用域:openid、profile、email(身份),account(我是谁),read、write(REST API 和 MCP 服务器),app(打开私有应用),offline_access(刷新令牌),agent(机器客户端)。
用户已经授予过该客户端的作用域会跳过同意页。已授权的应用列在账号 → 已连接应用,可以在那里撤销。
正在共享工作区里工作?令牌会作用于该工作区的资源(owner 声明),权限取决于用户在那里的角色。 把私有应用的地址作为 resource,访问令牌的受众就变成那个应用。边缘网关接受它作为 Bearer 头,所以你在 RandallFlare 上构建的 MCP 服务器和 API 不需要自己的登录页;应用通过 RF-Access-User-Id 和 RF-Access-User-Email 看到用户。私有应用返回的 401 带有 WWW-Authenticate: Bearer resource_metadata=…,MCP 客户端正是由此找到这个授权服务器。
bash
# A token for one private app: name it as the resource
curl -s https://randallflare.com/oauth/token -d grant_type=authorization_code … \
-d resource=https://notes.edge.randallflare.com
# The access token's audience is that app; send it as a Bearer header and the gate lets you in
curl https://notes.edge.randallflare.com/mcp -H 'authorization: Bearer eyJ…'登录状态下注册的客户端可以使用 client_credentials 和 agent 作用域。它的令牌代表所有者的账号(带 read/write),并且在 resource=human-check 时可以通过任何站点的人机验证 :站点服务器收到 success: true 和 agent 的客户端 id,而不是浏览器谜题。
bash
# A machine client (registered while signed in, with client_credentials)
curl -s -u "$CLIENT_ID:$CLIENT_SECRET" https://randallflare.com/oauth/token \
-d grant_type=client_credentials -d scope=agent -d resource=human-check
# Send the token where a browser would send the human-check response:
curl https://your-site.example/form -d token=eyJ… # your server's siteverify call succeeds with "agent": "client:…"设备密钥:在账号 → 安全里为当前设备添加一个 passkey;之后用屏幕锁或安全密钥登录,不再需要密码或邮箱验证码。bigrandall.io 和 randallflare.com 分别保存各自的设备密钥。 一个账号在两个站点都能用;私有应用会把你送到已经有会话的那个站点。 访问令牌是平台签名的 EdDSA JWT(/.well-known/jwks.json),有效期一小时;id_token 按作用域携带 nonce、name、preferred_username、email 和 picture。