fix: admin role mapping grants only, revoke behind opt-in

SSO login for an existing admin whose token lacked the admin role was
silently demoting the account, locking admins out of the dashboard.
Missing admin role now leaves the flag alone unless
RevokeAdminWithoutRole is enabled.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Pascal Linxweiler
2026-07-13 14:44:07 +02:00
parent 606f14dfab
commit 7dc79bf003
8 changed files with 36 additions and 8 deletions

View File

@@ -50,6 +50,12 @@ public class PluginConfiguration : BasePluginConfiguration
/// </summary>
public string AllowedRoles { get; set; } = string.Empty;
/// <summary>
/// Gets or sets a value indicating whether a missing admin role also revokes an
/// existing administrator flag on OIDC login. Off by default: admin roles only grant.
/// </summary>
public bool RevokeAdminWithoutRole { get; set; }
/// <summary>
/// Gets or sets a value indicating whether unknown users are created on first login.
/// </summary>