Open Closed

Ldap access error #8584


User avatar
0
marco.susani created
  • ABP Framework version: v9.0.2
  • UI Type: MVC
  • Database System: EF Core with SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): tiered yes with auth server app separated
  • Exception message and full stack trace:
  • 2025-01-03 18:42:31.247 +01:00 [ERR] Credenziali non valide. Credenziali non valide. Result: 49. Method: ldap_parse_result. Details: errorMessage: 80090308: LdapErr: DSID-0C090511, comment: AcceptSecurityContext error, data 52e, v4f7c matchedMessage: LdapForNet.LdapInvalidCredentialsException: Credenziali non valide. Credenziali non valide. Result: 49. Method: ldap_parse_result. Details: errorMessage: 80090308: LdapErr: DSID-0C090511, comment: AcceptSecurityContext error, data 52e, v4f7c matchedMessage: at LdapForNet.Native.LdapNative.ThrowIfError(SafeHandle ld, Int32 res, String method, IDictionary`2 details) at LdapForNet.LdapConnection.ThrowIfParseResultError(IntPtr msg) at LdapForNet.LdapConnection.BindAsync(LdapAuthType authType, LdapCredential ldapCredential) at Volo.Abp.Ldap.LdapManager.AuthenticateLdapConnectionAsync(ILdapConnection connection, String username, String password) at Volo.Abp.Ldap.LdapManager.AuthenticateAsync(String username, String password)
  • Steps to reproduce the issue: Login with ldap credential
  • I tried to use the AbpLdapSample console app and with the same configuration parameters and it works!

2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I tried to use the AbpLdapSample console app

    Can you share your test code?

    liming.ma@volosoft.com

    Thanks.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please try to using MyOpenLdapManager to check the username and password

    [Dependency(ReplaceServices = true)]
    [ExposeServices(typeof(OpenLdapManager), typeof(ILdapManager), typeof(LdapManager))]
    public class MyOpenLdapManager : OpenLdapManager
    {
        public MyOpenLdapManager(ILdapSettingProvider ldapSettingProvider)
            : base(ldapSettingProvider)
        {
    
        }
        
        protected async override Task<string> NormalizeUserNameAsync(string userName)
        {
            var username = $"cn={userName},{await LdapSettingProvider.GetBaseDcAsync()}";
            Logger.LogError("MyOpenLdapManager username: " + username);
            return username;
        }
    
        protected async override Task AuthenticateLdapConnectionAsync(ILdapConnection connection, string username, string password)
        {
            Logger.LogError("MyOpenLdapManager username: " + username);
            Logger.LogError("MyOpenLdapManager password: " + password);
            await connection.BindAsync(Native.LdapAuthType.Simple, new LdapCredential()
            {
                UserName = username,
                Password = password
            });
        }
    }
    
    
Made with ❤️ on ABP v9.1.0-preview. Updated on January 02, 2025, 07:06