diff --git a/framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapManager.cs b/framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapManager.cs index 7a8d06746a..c9be1063d1 100644 --- a/framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapManager.cs +++ b/framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapManager.cs @@ -12,11 +12,11 @@ namespace Volo.Abp.Ldap public class LdapManager : ILdapManager, ITransientDependency { public ILogger Logger { get; set; } - protected AbpLdapOptions LdapOptions { get; } + protected IOptions LdapOptions { get; } - public LdapManager(IOptions ldapSettingsOptions) + public LdapManager(IOptions ldapOptions) { - LdapOptions = ldapSettingsOptions.Value; + LdapOptions = ldapOptions; Logger = NullLogger.Instance; } @@ -50,11 +50,11 @@ namespace Volo.Abp.Ldap return Task.CompletedTask; } - protected virtual Task ConnectAsync(ILdapConnection ldapConnection) + protected virtual async Task ConnectAsync(ILdapConnection ldapConnection) { - ldapConnection.Connect(LdapOptions.ServerHost, LdapOptions.ServerPort); + await LdapOptions.SetAsync(); - return Task.CompletedTask; + ldapConnection.Connect(LdapOptions.Value.ServerHost, LdapOptions.Value.ServerPort); } protected virtual async Task AuthenticateLdapConnectionAsync(ILdapConnection connection, string username, string password)