AdminUI LDAP: drops FallbackServers/BindMode/…, signs in users with no mapped role, and the library logs nothing #913
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:
LdapOptions.ToLibraryOptions()(Security/Ldap/LdapOptions.cs:111) dropsFallbackServers,BindMode,UserBindTemplateandAcceptDomainQualifiedNames, so there is no AD DC failover.AuthEndpoints.cs:124-158signs in with an empty role set, including when the mapper throws, andAuthenticatedReadadmits any authenticated user. Once the search base is a whole AD domain, any directoryuser gets AdminUI read access and a token. The fix refuses empty roles at
/auth/loginand/auth/token,and refuses when the mapper throws. This reverses
Login_when_role_mapper_throws_signs_in_with_no_role_claims.OtOpcUaLdapAuthService.cs:48passes no logger to the library, so failover and stage logs are missing.Inject
ILogger<LdapAuthService>.rules only. Not
ServiceAccountDn, because DEV boots on code defaults with an empty DN.Acceptance: failover on the redundant GLAuth pair, a zero-role user refused (cookie + token), and a
DEV-shaped config boots. Plan:
scadaproj/docs/plans/2026-11-15-nam-ldap-cutover.md§2.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
masterincdf433a35(branchfix/913-adminui-ldap-options:c996b462c,46d9a19bc,19a445bb6). Not deployed. Deployment is on hold by owner decision and is tracked with the cutover in scadaproj#6.What changed:
ToLibraryOptions()now passesFallbackServers,BindMode,UserBindTemplateandAcceptDomainQualifiedNamesthrough to the library. A two-way reflection test fails on any library property that is not mapped or explicitly listed as unmapped. OnlyServerCertificateValidationCallbackis unmapped, because it can't be set from config./auth/tokenreturns 401 for a cookie session that has no role.ILogger<LdapAuthService>is now injected.hostorhost:port, andBindMode=Userneeds a template containing{0}exactly once.ServiceAccountDnis not required, and a test confirms the DEV-shaped config still boots.docs/security.mdanddocs/Configuration.mdwere updated.Tests:
Notes for rollout:
AuthenticatedReadstill admits a signed-in user with no roles. Restart the service or accept that window (plan §7.5).