fix(admin): require air-admin Keycloak realm role

This commit is contained in:
Shard
2026-04-04 14:38:23 +00:00
parent 9f5bcf4d21
commit c1c0908903
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -102,13 +102,13 @@ builder.Services
}; };
}); });
// All Blazor pages require the "admin" Keycloak realm role by default. // All Blazor pages require the "air-admin" Keycloak realm role by default.
// Override per-page with [AllowAnonymous] (e.g. the login/challenge shim). // Override per-page with [AllowAnonymous] (e.g. the login/challenge shim).
builder.Services.AddAuthorization(options => builder.Services.AddAuthorization(options =>
{ {
options.FallbackPolicy = new AuthorizationPolicyBuilder() options.FallbackPolicy = new AuthorizationPolicyBuilder()
.RequireAuthenticatedUser() .RequireAuthenticatedUser()
.RequireRole("admin") .RequireRole("air-admin")
.Build(); .Build();
}); });
+1 -1
View File
@@ -32,7 +32,7 @@
// A confidential client "sor-admin" must be created in the Keycloak realm with: // A confidential client "sor-admin" must be created in the Keycloak realm with:
// - Valid redirect URI: https://<admin-host>/signin-oidc // - Valid redirect URI: https://<admin-host>/signin-oidc
// - Post-logout URI: https://<admin-host>/signout-callback-oidc // - Post-logout URI: https://<admin-host>/signout-callback-oidc
// - "admin" realm role assigned to any user who should access this panel // - "air-admin" realm role assigned to any user who should access this panel
"Keycloak": { "Keycloak": {
"Authority": "https://auth.aeternalisgames.com/realms/aeternalis", "Authority": "https://auth.aeternalisgames.com/realms/aeternalis",
"ClientId": "sor-admin", "ClientId": "sor-admin",