as sample below bind =BindAsync working cn.Bind(LdapAuthType.Digest, new LdapCredential { UserName = "username", Password = "clearTextPassword", AuthorizationId = "u:admin" });
how can i override from abp?
--- admin auth vs were abp override method??
await ldapConnection.BindAsync(LdapAuthType.Negotiate, new LdapCredential
{
// Configure username according to your LDAP config:
// cn=admin,dc=abp,dc=com or just username.
UserName = adminUserName,
Password = adminPassword,
AuthorizationId = baseDc,
});
--- user auth as below sample abp override method??
var searchResults = await ldapConnection.SearchAsync(baseDc, $"(&(objectClass=user)(cn={testUserName}))");
//var searchResults = await ldapConnection.SearchAsync(baseDc, $"(&(uid={testUserName}))");
Console.WriteLine();
Console.WriteLine($"{testUserName} attributes:");
var userEntry = searchResults.First();
Console.WriteLine(string.Join(", ", userEntry.ToDirectoryEntry().Attributes));
await ldapConnection.BindAsync(Native.LdapAuthType.Simple, new LdapCredential
{
UserName = userEntry.Dn,
Password = testPassword
});
here abp - not sure which one has user auth and admin auth call.. after that it make the entry in user table
public class LdapManager : ILdapManager, ITransientDependency { public ILogger<LdapManager> Logger { get; set; } protected ILdapSettingProvider LdapSettingProvider { get; }
public LdapManager(ILdapSettingProvider ldapSettingProvider)
{
LdapSettingProvider = ldapSettingProvider;
Logger = NullLogger<LdapManager>.Instance;
}
public virtual async Task<bool> AuthenticateAsync(string username, string password)
{
try
{
using (var conn = await CreateLdapConnectionAsync())
{
await AuthenticateLdapConnectionAsync(conn, username, password);
return true;
}
}
catch (Exception ex)
{
Logger.LogException(ex);
return false;
}
}
protected virtual async Task<ILdapConnection> CreateLdapConnectionAsync()
{
var ldapConnection = new LdapConnection();
await ConfigureLdapConnectionAsync(ldapConnection);
await ConnectAsync(ldapConnection);
return ldapConnection;
}
protected virtual Task ConfigureLdapConnectionAsync(ILdapConnection ldapConnection)
{
return Task.CompletedTask;
}
protected virtual async Task ConnectAsync(ILdapConnection ldapConnection)
{
ldapConnection.Connect(await LdapSettingProvider.GetServerHostAsync(), await LdapSettingProvider.GetServerPortAsync());
}
protected virtual async Task AuthenticateLdapConnectionAsync(ILdapConnection connection, string username, string password)
{
await connection.BindAsync(Native.LdapAuthType.Simple, new LdapCredential()
{
UserName = username,
Password = password
});
}
}
Hi maliming,
As you see code/error getting from sample application(https://github.com/abpframework/abp-samples/tree/master/AbpLdapSample). we followed same document to enable the ldap. now we are getting same issue as (https://support.abp.io/QA/Questions/754/How-To-use--LDAP-authentication) for that and this issue looking for answer.
I have refer below and nothing found solution. we are getting same issue Can you please provide updated fix? https://support.abp.io/QA/Questions/754/How-To-use--LDAP-authentication
sample out side https://www.codemag.com/article/1312041/Using-Active-Directory-in-.NET
I am not able see below folder . Can you please send what ever it was done from your end? also we are facing same issue on proxy as well. i guess it same lib causing both issues
angular.suite\schematics
I am not able see below folder . Can you please send what ever it was done from your end? also we are facing same issue on proxy as well. i guess it same lib causing both issues
angular.suite\schematics
No - Can you please provide step to correct it what i am doing wrong. Is that possible we can connect on zoom or call or private call.. this is very critical now lot of entities need to update/added.
Can I provide the list entities what we need..
i have tried same but it not showing after.. it brand new project also not working
secondly, we are not unable to create the proxy for given controls.
yes - it was not giving any error. but nothing got created?
Hi @vijay.nallala,
Have you changed the location of
angular
folder?
no location and all same created from abp suite