You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "hanahmily (via GitHub)" <gi...@apache.org> on 2026/10/23 02:29:34 UTC
[I] [Feature] Canopy auth 3/6: API tokens (hzn_ bearer, SHA-256 tokens file) [skywalking]
hanahmily opened a new issue, #14161:
URL: https://github.com/apache/skywalking/issues/14161
## Summary (executable leaf 4/6 of #14001)
The `sso` backend: OIDC and OAuth2 login with role mapping, following Horizon's `apps/bff/src/user/oidc/` (`discovery.ts`, `flows.ts`, `identity.ts`, `route.ts`, `userinfo.ts`) and `roles.ts`. Depends on leaves 1–2.
## Required change
1. `auth.backend: sso` with `auth.sso.providers[]`, in Horizon's provider shape: an OIDC provider (issuer discovery, e.g. Google) and an OAuth2 provider (explicit authorize/token/userinfo endpoints, e.g. GitHub). Authorization-code flow with PKCE and `state`/`nonce`; the client secret comes from env or a file, never the config file in clear.
2. Routes: start (`GET /auth/sso/:provider/start`) and callback (`GET /auth/sso/:provider/callback`) create a leaf-2 session for the resolved principal. `GET /auth/meta` (or the existing meta) lists the configured providers for the web login page.
3. Role mapping `auth.sso.roles`: `defaultRoles`, `roleByEmail` (exact, case-insensitive), `roleByDomain`, mapped to Canopy roles via leaf 1's mapping. With no matching role, the login is refused, not given a default admin.
4. The resolution order in the middleware becomes Horizon's: IdP bearer token, if supported by the provider (see out of scope), → API token (leaf 3) → cookie session.
5. Web: the login page shows a button per provider when `backend: sso`.
6. An SSO health probe (discovery or token endpoint reachable) exposed internally for leaf 5.
## Concrete oracle (against a mock IdP; no live provider)
- Mock OIDC issuer: start → redirect with PKCE `code_challenge`, `state`, `nonce` → callback with a valid code → session cookie, `/auth/session` shows the mapped role.
- `roleByEmail: {alice@x.com: admin}`, `roleByDomain: {x.com: viewer}` → alice is admin and carol@x.com readonly. eve@y.com with no `defaultRoles` → refused (403 page/JSON).
- A wrong `state` or replayed code → 400, no session. An ID token with a wrong `nonce`, `aud` or issuer → refused.
- Mock GitHub-style OAuth2 (userinfo plus emails endpoint) → email resolved, role mapped.
## Acceptance criteria
- [ ] Vitest tests with an in-process mock IdP (no network) for each oracle line.
- [ ] The #14001 acceptance "GitHub OAuth2 end-to-end (consent screen)" is covered by the mock flow here, plus a documented manual check with a real GitHub OAuth app (steps in the README); the manual check isn't automated.
- [ ] Existing tests pass; web login page tests cover the provider buttons.
## Out of scope
Break-glass (leaf 5), LDAP/SAML, multi-IdP failover, and accepting IdP access tokens as bearers if Horizon does not (follow Horizon; note the choice).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Feature] Canopy auth 3/6: API tokens (hzn_ bearer, SHA-256 tokens file) [skywalking]
Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily closed issue #14161: [Feature] Canopy auth 3/6: API tokens (hzn_ bearer, SHA-256 tokens file)
URL: https://github.com/apache/skywalking/issues/14161
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Feature] Canopy auth 3/6: API tokens (hzn_ bearer, SHA-256 tokens file) [skywalking]
Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily commented on issue #14161:
URL: https://github.com/apache/skywalking/issues/14161#issuecomment-6356035683
Merged into #14159 (Canopy auth 1/2) to keep each pull request a reviewable but not tiny unit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org