Browse Source

LdapOptions to AbpLdapOptions

pull/1919/head
Yunus Emre Kalkan 7 years ago
parent
commit
b7e2ec64a2
  1. 2
      framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/AbpLdapModule.cs
  2. 4
      framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/AbpLdapOptions.cs
  3. 4
      framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapManager.cs
  4. 2
      framework/test/Volo.Abp.Ldap.Tests/Volo/Abp/Ldap/Authenticate_Tests.cs
  5. 2
      framework/test/Volo.Abp.Ldap.Tests/Volo/Abp/Ldap/LdapManager_Tests.cs

2
framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/AbpLdapModule.cs

@ -12,7 +12,7 @@ namespace Volo.Abp.Ldap
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
var configuration = context.Services.GetConfiguration(); var configuration = context.Services.GetConfiguration();
Configure<LdapOptions>(configuration.GetSection("LDAP")); Configure<AbpLdapOptions>(configuration.GetSection("LDAP"));
} }
} }
} }

4
framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapOptions.cs → framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/AbpLdapOptions.cs

@ -1,6 +1,6 @@
namespace Volo.Abp.Ldap namespace Volo.Abp.Ldap
{ {
public class LdapOptions public class AbpLdapOptions
{ {
public string ServerHost { get; set; } public string ServerHost { get; set; }
@ -16,7 +16,7 @@
public LdapCredentials Credentials { get; set; } public LdapCredentials Credentials { get; set; }
public LdapOptions() public AbpLdapOptions()
{ {
Credentials = new LdapCredentials(); Credentials = new LdapCredentials();
} }

4
framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapManager.cs

@ -12,7 +12,7 @@ namespace Volo.Abp.Ldap
public class LdapManager : ILdapManager, ITransientDependency public class LdapManager : ILdapManager, ITransientDependency
{ {
private readonly string _searchBase; private readonly string _searchBase;
private readonly LdapOptions _ldapOptions; private readonly AbpLdapOptions _ldapOptions;
private readonly string[] _attributes = private readonly string[] _attributes =
{ {
@ -21,7 +21,7 @@ namespace Volo.Abp.Ldap
"sAMAccountName", "userPrincipalName", "telephoneNumber", "mail" "sAMAccountName", "userPrincipalName", "telephoneNumber", "mail"
}; };
public LdapManager(IOptions<LdapOptions> ldapSettingsOptions) public LdapManager(IOptions<AbpLdapOptions> ldapSettingsOptions)
{ {
_ldapOptions = ldapSettingsOptions.Value; _ldapOptions = ldapSettingsOptions.Value;
_searchBase = _ldapOptions.SearchBase; _searchBase = _ldapOptions.SearchBase;

2
framework/test/Volo.Abp.Ldap.Tests/Volo/Abp/Ldap/Authenticate_Tests.cs

@ -57,7 +57,7 @@ namespace Volo.Abp.Ldap
// "ServerPort": 636, // "ServerPort": 636,
// "UseSSL": true // "UseSSL": true
// } // }
Configure<LdapOptions>(settings => Configure<AbpLdapOptions>(settings =>
{ {
settings.ServerHost = "192.168.101.54"; settings.ServerHost = "192.168.101.54";
settings.ServerPort = 636; settings.ServerPort = 636;

2
framework/test/Volo.Abp.Ldap.Tests/Volo/Abp/Ldap/LdapManager_Tests.cs

@ -227,7 +227,7 @@ namespace Volo.Abp.Ldap
// "DomainName": "yourdomain.com.cn", // "DomainName": "yourdomain.com.cn",
// "DomainDistinguishedName": "DC=yourdomain,DC=com,DC=cn" // "DomainDistinguishedName": "DC=yourdomain,DC=com,DC=cn"
// } // }
Configure<LdapOptions>(settings => Configure<AbpLdapOptions>(settings =>
{ {
settings.ServerHost = "192.168.101.54"; settings.ServerHost = "192.168.101.54";
settings.ServerPort = 636; settings.ServerPort = 636;

Loading…
Cancel
Save