Expand web login current-user profile scopes
This commit is contained in:
parent
d4d2f98296
commit
b91b1f95ce
@ -111,7 +111,7 @@
|
||||
- Login / Logout return URL allowlist 分開驗證,採 URI origin 與 path segment prefix 比對,不使用原始字串 `StartsWith`。
|
||||
- API 可用 `Auth:WebLoginUrl` 指定登入頁位置;預設為 `/account/login`。
|
||||
- `web_login` 可使用 public client + PKCE,不要求 client secret。
|
||||
- `web_login` client 可使用 `openid email profile`,並預留 `profile:basic.read`。
|
||||
- `web_login` client 可使用 `openid email profile` 與 current-user `profile:*` scopes;這些 scopes 僅能操作 access token subject 自己的資料。
|
||||
|
||||
### 6.2 OAuth2 API 使用(站點自行 UI)
|
||||
1) 站點以 API 驗證使用者登入(會員中心提供 login API)
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
- 使用 Authorization Code + PKCE
|
||||
- 需設定 `redirect_uris`
|
||||
- 可使用 `client_type=public`
|
||||
- 允許 scope:`openid`、`email`、`profile`、`profile:basic.read`
|
||||
- 允許 scope:`openid`、`email`、`profile`、全部 current-user `profile:*`
|
||||
- `usage=webhook_outbound`:
|
||||
- 供 Member Center 內部標記「對外 webhook 用」的租戶憑證用途
|
||||
- 不可用於租戶 API 呼叫
|
||||
|
||||
@ -78,7 +78,7 @@ Token audience 由 scope → resource registry 計算。
|
||||
|
||||
| Usage | Client 型態 / Tenant | 預設 scopes |
|
||||
|---|---|---|
|
||||
| `web_login` | public 或 confidential;互動式登入 | `openid`、`email`、`profile`、`profile:basic.read` |
|
||||
| `web_login` | public 或 confidential;互動式登入 | `openid`、`email`、`profile`、全部 current-user `profile:*` |
|
||||
| `tenant_api` | confidential;必須綁 tenant | `newsletter:events.write`、`newsletter:list.read`、`newsletter:subscriptions.read/write`、全部 `profile:*` |
|
||||
| `platform_service` | confidential;可不綁 tenant | `newsletter:events.write.global`、`newsletter:list.read.global`、全部 `profile:*` |
|
||||
| `send_api` | confidential;必須綁 tenant | `newsletter:send.read/write` |
|
||||
|
||||
@ -82,7 +82,12 @@ public sealed class AuthResourceRegistryService : IAuthResourceRegistryService
|
||||
OpenIddictConstants.Scopes.OpenId,
|
||||
OpenIddictConstants.Scopes.Email,
|
||||
OpenIddictConstants.Scopes.Profile,
|
||||
"profile:basic.read"
|
||||
"profile:basic.read",
|
||||
"profile:basic.write",
|
||||
"profile:addresses.read",
|
||||
"profile:addresses.write",
|
||||
"profile:subscriptions.read",
|
||||
"profile:subscriptions.write"
|
||||
], cancellationToken);
|
||||
|
||||
await EnsureUsagePermissionsAsync("webhook_outbound", [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user