hi
What is your UI type?
Can you share a GIF to show the problem?
Can you share the logs.txt file?
https://abp.io/support/questions/8622/How-to-enable-Debug-logs-for-troubleshoot-problems
liming.ma@volosoft.com
Thanks
Great 👍
Hi
Override the layout file is the right way. You can ignore the AI’s answer.
Thanks.
hi
I don't have much to suggest, Microsoft's documentation basically covers it all.
Thanks.
Great. Can you share your solution?
Thanks.
hi
You don't need to add the entire account pro module source code to your solution.
You just need to add Login.cshtml
and Login.cshtml
files.
If you don't know how to add these two files. You can share your project with liming.ma@volosoft.com
I will add and send it back to you.
Thanks.
hi
Have you logged into your ABP account?
> abp login
What is the output of the abp login-info
command?
Thanks
hi
What is your UI page? MVC, Angular, or Blazor?
There is an AcceptLanguageHeaderRequestCultureProvider(accept-language )
by default.
It will use your browser language instead of your default language.
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/localization/select-language-culture?view=aspnetcore-9.0#configure-localization-middleware
Can you check the accept-language
value in your browser?
Thanks.
hi
The LdapManager
class code at: https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapManager.cs
The OpenLdapManager
class code are:
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(OpenLdapManager), typeof(ILdapManager), typeof(LdapManager))]
public class OpenLdapManager : LdapManager
{
public OpenLdapManager(ILdapSettingProvider ldapSettingProvider)
: base(ldapSettingProvider)
{
}
public virtual async Task<string> GetUserEmailAsync(string userName)
{
using (var conn = await CreateLdapConnectionAsync())
{
await AuthenticateLdapConnectionAsync(conn, await NormalizeUserNameAsync(await LdapSettingProvider.GetUserNameAsync()), await LdapSettingProvider.GetPasswordAsync());
var searchResults = await conn.SearchAsync(await GetBaseDnAsync(), await GetUserFilterAsync(userName));
try
{
var userEntry = searchResults.First();
return await GetUserEmailAsync(userEntry);
}
catch (LdapException e)
{
Logger.LogException(e);
}
return null;
}
}
protected async override Task ConnectAsync(ILdapConnection ldapConnection)
{
var schema = await LdapSettingProvider.GetLdapOverSsl() ? Native.LdapSchema.LDAPS : Native.LdapSchema.LDAP;
ldapConnection.Connect(await LdapSettingProvider.GetServerHostAsync(), await LdapSettingProvider.GetServerPortAsync(), schema);
}
protected virtual async Task<string> NormalizeUserNameAsync(string userName)
{
return $"cn={userName},{await LdapSettingProvider.GetBaseDcAsync()}";
}
protected virtual Task<string> GetUserEmailAsync(LdapEntry ldapEntry)
{
return Task.FromResult(ldapEntry.ToDirectoryEntry().GetAttribute("mail")?.GetValue<string>());
}
protected virtual async Task<string> GetBaseDnAsync()
{
return await LdapSettingProvider.GetBaseDcAsync();
}
protected virtual Task<string> GetUserFilterAsync(string userName)
{
return Task.FromResult($"(&(uid={userName}))");
}
}