From 3e50deecb7694dfefd520c9b1d97fcd059c9b861 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Thu, 26 Sep 2024 13:37:39 -0400 Subject: [PATCH] fix remote login issue which could occut if multiple users have the same email address --- .../Extensions/OqtaneSiteAuthenticationBuilderExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Oqtane.Server/Extensions/OqtaneSiteAuthenticationBuilderExtensions.cs b/Oqtane.Server/Extensions/OqtaneSiteAuthenticationBuilderExtensions.cs index 1729358bb..aa593f833 100644 --- a/Oqtane.Server/Extensions/OqtaneSiteAuthenticationBuilderExtensions.cs +++ b/Oqtane.Server/Extensions/OqtaneSiteAuthenticationBuilderExtensions.cs @@ -592,7 +592,7 @@ private static async Task ValidateUser(string id, string name, s } // create claims identity - identityuser = await _identityUserManager.FindByEmailAsync(user.Username); + identityuser = await _identityUserManager.FindByNameAsync(user.Username); user.SecurityStamp = identityuser.SecurityStamp; identity = UserSecurity.CreateClaimsIdentity(alias, user, userRoles); identity.Label = ExternalLoginStatus.Success; @@ -645,7 +645,7 @@ private static async Task ValidateUser(string id, string name, s } } - _logger.Log(LogLevel.Information, "ExternalLogin", Enums.LogFunction.Security, "External User Login Successful For {Username} From IP Address {IPAddress} Using Provider {Provider}", user.Username, httpContext.Connection.RemoteIpAddress, providerName); + _logger.Log(LogLevel.Information, "ExternalLogin", Enums.LogFunction.Security, "External User Login Successful For {Username} From IP Address {IPAddress} Using Provider {Provider}", user.Username, httpContext.Connection.RemoteIpAddress.ToString(), providerName); } } else // claims invalid