Replace SOR.Admin email/password login with Keycloak OIDC

Admin panel now delegates authentication entirely to Keycloak using the
Authorization Code flow. The local Identity password form and
IdentityRevalidatingAuthenticationStateProvider are removed. Access requires
the "admin" Keycloak realm role, mirroring the game's role-based auth model.

- Program.cs: AddOpenIdConnect("Keycloak") with cookie session; /auth/challenge
  triggers the OIDC flow; /auth/logout signs out of both cookie and Keycloak SSO
- Login.razor: replaced HTML form with an immediate redirect to /auth/challenge
- IdentityRevalidatingAuthenticationStateProvider.cs: deleted (no longer needed)
- appsettings.json: Keycloak:Authority / ClientId / ClientSecret section added
- Directory.Packages.props: pinned Microsoft.AspNetCore.Authentication.OpenIdConnect 8.0.0
- SOR.Admin.csproj: added OpenIdConnect package reference

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-04-04 08:46:27 -04:00
co-authored by Claude Happy
parent cfb10ae4d0
commit fa695649f6
6 changed files with 116 additions and 165 deletions
+1
View File
@@ -18,6 +18,7 @@
<PackageVersion Include="Grpc.Net.ClientFactory" Version="2.62.0" />
<!-- ── NATS ───────────────────────────────────────────────────────────── -->
<!-- Official NATS .NET client (NATS.Net is the modern unified package) -->
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.0" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.0.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.0.0" />
<PackageVersion Include="NATS.Net" Version="2.3.0" />