fix(admin): require air-admin Keycloak realm role
This commit is contained in:
@@ -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();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user