🪪
OIDC 身份层
id_token 直验签,跨应用身份零信任
OpenID Connect 在 OAuth 2.1 之上叠加身份层。id_token 为 JWT,包含用户声明,应用本地验签无需回调 UM。scope=openid profile email 即可获得。
example.http
# 请求 id_token(scope 含 openid)
GET /oauth/authorize?
response_type=code&
client_id=YOUR_APP_KEY&
scope=openid%20profile%20email&
...
# token 响应含 id_token
{
"access_token": "eyJ...",
"token_type": "Bearer",
"expires_in": 3600,
"id_token": "eyJ...", // JWT,含用户声明
"scope": "openid profile email"
}
# id_token 载荷(JWT decode)
{
"iss": "https://um.yunjii.cn",
"sub": "umid_8x4k...",
"aud": "YOUR_APP_KEY",
"exp": 1730000000,
"iat": 1729996400,
"nickname": "张三",
"picture": "https://..."
}核心能力
6 项核心能力,每项独立可用
id_token 本地验签
JWT 含用户声明,应用用公钥本地验签,无需回调 UM
标准 scope
openid / profile / email,按需申请用户信息字段
Discovery 文档
/.well-known/openid-configuration 暴露所有端点与公钥
JWKS 公钥
/oauth/jwks 暴露公钥集,应用定期拉取用于验签
sub 即 UMID
id_token.sub 是用户在云集栈的唯一标识
nonce 防重放
可选 nonce 参数,原样返回在 id_token 中
API 端点
通过 /api/* 调用以下端点
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | /.well-known/openid-configuration | OIDC Discovery 文档 |
| GET | /oauth/jwks | JWKS 公钥集 |
| GET | /oauth/userinfo | UserInfo 端点 |