diff --git a/src/ZB.MOM.WW.MxGateway.Server/Dashboard/DashboardServiceCollectionExtensions.cs b/src/ZB.MOM.WW.MxGateway.Server/Dashboard/DashboardServiceCollectionExtensions.cs
index 720f0d8..133b878 100644
--- a/src/ZB.MOM.WW.MxGateway.Server/Dashboard/DashboardServiceCollectionExtensions.cs
+++ b/src/ZB.MOM.WW.MxGateway.Server/Dashboard/DashboardServiceCollectionExtensions.cs
@@ -22,7 +22,8 @@ public static class DashboardServiceCollectionExtensions
/// Service collection to register services.
///
/// Application configuration, used to bind the shared LDAP provider's options
- /// from the MxGateway:Ldap section.
+ /// from the MxGateway:Ldap section. Also read to select the dashboard
+ /// authentication scheme via the MxGateway:Dashboard:DisableLogin dev flag.
///
public static IServiceCollection AddGatewayDashboard(
this IServiceCollection services,
@@ -80,7 +81,9 @@ public static class DashboardServiceCollectionExtensions
"DASHBOARD LOGIN DISABLED (MxGateway:Dashboard:DisableLogin=true) — every request is "
+ "authenticated as '{User}' with full permissions ({Roles}). Dev/test only; never "
+ "enable in production.",
- gatewayOptions.Dashboard.AutoLoginUser ?? DashboardAutoLoginAuthenticationHandler.DefaultUser,
+ string.IsNullOrWhiteSpace(gatewayOptions.Dashboard.AutoLoginUser)
+ ? DashboardAutoLoginAuthenticationHandler.DefaultUser
+ : gatewayOptions.Dashboard.AutoLoginUser!.Trim(),
$"{DashboardRoles.Admin}, {DashboardRoles.Viewer}"));
}
else