diff --git a/src/Infrastructure/Configurations/IdentitySettings.cs b/src/Infrastructure/Configurations/IdentitySettings.cs index cd51721a..2379a4b8 100644 --- a/src/Infrastructure/Configurations/IdentitySettings.cs +++ b/src/Infrastructure/Configurations/IdentitySettings.cs @@ -51,4 +51,6 @@ public class IdentitySettings : IIdentitySettings /// public int MaxFailedAccessAttempts { get; set; } = 5; + public string AllowedUserNameCharacters { get; set; } = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@+'"; + } diff --git a/src/Infrastructure/DependencyInjection.cs b/src/Infrastructure/DependencyInjection.cs index 4b340b2a..fc0e3755 100644 --- a/src/Infrastructure/DependencyInjection.cs +++ b/src/Infrastructure/DependencyInjection.cs @@ -230,6 +230,7 @@ private static IServiceCollection AddAuthenticationService(this IServiceCollecti // User settings options.User.RequireUniqueEmail = true; + options.User.AllowedUserNameCharacters = identitySettings.AllowedUserNameCharacters; //options.Tokens.EmailConfirmationTokenProvider = "Email"; }); diff --git a/src/Server.UI/appsettings.json b/src/Server.UI/appsettings.json index 1fb93e00..1a12f641 100644 --- a/src/Server.UI/appsettings.json +++ b/src/Server.UI/appsettings.json @@ -72,7 +72,8 @@ "RequireLowerCase": true, "DefaultLockoutTimeSpan": 30, "MaxFailedAccessAttempts": 5, - "SecureCookies": true + "SecureCookies": true, + "AllowedUserNameCharacters": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@+'" }, "Notify": { "ApiKey": "",