Fix Central launch profile: auth middleware, cookie auth, antiforgery, static files

- Add UseAuthentication/UseAuthorization/UseAntiforgery/UseStaticFiles middleware
- Register ASP.NET Core cookie authentication scheme in AddSecurity()
- Update auth endpoints to use SignInAsync/SignOutAsync (proper cookie auth)
- Add [AllowAnonymous] to login page
- Create wwwroot for static file serving
- Regenerate clean EF migration after model changes

Verified with launch profile "ScadaLink Central":
- Host starts, connects to SQL Server, applies EF migrations
- Akka.NET cluster forms (remoting on 8081, node joins self as leader)
- /health/ready returns Healthy (DB + Akka checks)
- LDAP auth works (admin/password via GLAuth → 302 + auth cookie set)
- Login page renders (HTTP 200)
- Unauthenticated requests redirect to /login
This commit is contained in:
Joseph Doherty
2026-03-17 03:43:11 -04:00
parent 121983fd66
commit 0b10747bd2
6 changed files with 1061 additions and 24 deletions

View File

@@ -1,4 +1,6 @@
@page "/login"
@using Microsoft.AspNetCore.Authorization
@attribute [AllowAnonymous]
<div class="container" style="max-width: 400px; margin-top: 10vh;">
<div class="card shadow-sm">