Central UI / /auth/token sign in users whose AD groups map to no role #144
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Body:
CentralUI/Auth/AuthEndpoints.cs:59-115signs in and mints a bearer with an empty role set. With adomain-wide NAM search base, any AD user reaches
DashboardandMonitoring/Health(bare[Authorize]). Thefamily standard (scadaproj NAM cutover plan §3.2) refuses login when no role is mapped. Fix login and token,
keep the refresh's end-on-zero, and add tests.
Acceptance: a zero-role user is refused at both endpoints. Plan:
docs/plans/2026-11-15-nam-ldap-cutover.md§2A.Plan: https://gitea.dohertylan.com/dohertj2/scadaproj/src/branch/main/docs/plans/2026-11-15-nam-ldap-cutover.md
Umbrella: scadaproj#6 (NAM AD cutover) · service account: scadaproj#58
Fixed and merged to
mainind48e1667(branchfix/144-refuse-zero-role-login:5a642d1c,2d8d5a3d,764e75c3). Not deployed. Deployment is on hold by owner decision and is tracked with the cutover in scadaproj#6.What changed:
/auth/loginand/auth/tokenrefuse a sign-in whose groups map to zero roles, and also refuse when the mapper throws. The client gets exactly what a bad password gets: the same redirect message or the same 401AUTH_FAILED, with no cookie or token.CookieSessionValidatornow ends a session whose refresh maps to zero roles, for both the DB re-map and the directory re-query. Before this, a user who stayed in only unmapped groups kept a role-less session that could read/and/monitoring/health.Component-Security.mdhas a new "No role, no login" section, andComponent-CentralUI.mdandCLAUDE.mdwere updated.Tests:
Known gap, not fixed here: the management API's HTTP Basic login (
ManagementAuthenticator) still admits a zero-role user to read-only queries. That needs a follow-up issue before the cutover (§7.4).Follow-up filed: ScadaBridge#145, the management API HTTP Basic / Bearer path still admits zero-role users. Fix it before the ScadaBridge cutover step (plan §7.4).