Activities of "devmahmod"

Do i need to copy all of this folder Account And put in my web project ?

Answer

hi can you provide me your mail please to send configuration to test i can't find problem

Answer

also ai said Install the necessary NuGet package:

Add the Volo.Abp.Account.Pro.Ldap package to your project.

and see screenshot i can't find it and i have abp pro

Answer

Thanks,

 var filter = $"(&(objectClass=person)(uid={testUserName}))"; this works for me when try this 

var server = "xxxx";
var serverPort = xxxx;
var baseDc = "xxxx";

var adminUserName = "xxxx";
var adminPassword = xxxx";

var testUserName = "xxxxx"; // short name or sAMAccountName
var testPassword = "xxxx"; // real user password

using (var ldapConnection = new LdapConnection())
{
    ldapConnection.Connect(server, serverPort, Native.LdapSchema.LDAP, Native.LdapVersion.LDAP_VERSION3);

    try
    {
        // Bind as admin
        await ldapConnection.BindAsync(Native.LdapAuthType.Simple, new LdapCredential
        {
            UserName = $"CN={adminUserName},{baseDc}",
            Password = adminPassword
        });

        Console.WriteLine($"{adminUserName} login success!");

        // Search user
        var filter = $"(&(objectClass=person)(uid={testUserName}))";
        var searchResults = await ldapConnection.SearchAsync(baseDc, filter);

        var userEntry = searchResults.FirstOrDefault();
        if (userEntry == null)
        {
            Console.WriteLine($"User '{testUserName}' not found.");
         
        }

        Console.WriteLine($"{testUserName} DN: {userEntry.Dn}");

        // Try binding as the user
        await ldapConnection.BindAsync(Native.LdapAuthType.Simple, new LdapCredential
        {
            UserName = userEntry.Dn,
            Password = testPassword
        });

        Console.WriteLine($"{testUserName} login success!");
    }
    catch (Exception e)
    {
        Console.WriteLine($"LDAP Error: {e.Message}");
    }

    Console.ReadKey();
}

I make this code in program.cs and it gives me login success and also can't login with this user , i tried to make cofigration from app setting and also admin ui not working

Answer

you mean i don't need to do any code to sync ldab users, but i tried steps and not work, can we please have meting in zoom ?

Answer

how user in ldap will be able to login and this user not in abpusers table ?

Answer

I try this code it gives me searchResults count 0

public async static Task<int> Main(string[] args)
{
    var server = "xxx.xxx.com";
    var serverPort = 12345;
    var baseDc = "DC=xxx,DC=com";
    var adminUserName = "xxx";
    var adminPassword = "xxx";
    var testUserName = "xxx@xxx.com"; // Replace with a real AD user
    var testPassword = "xxx";         // Replace with actual password

    using (var ldapConnection = new LdapConnection())
    {
        ldapConnection.Connect(server, serverPort, Native.LdapSchema.LDAP, Native.LdapVersion.LDAP_VERSION3);

        try
        {
            // Bind as LDAP admin (Bind DN)
            await ldapConnection.BindAsync(Native.LdapAuthType.Simple, new LdapCredential
            {
                UserName = $"CN={adminUserName},{baseDc}",  // Important: Full DN of bind user
                Password = adminPassword
            });

            Console.WriteLine($"{adminUserName} bind success!");

            // Search for the user using sAMAccountName (common in Active Directory)
            var filter = $"(&(objectClass=user)(sAMAccountName={testUserName}))";
            var searchResults = await ldapConnection.SearchAsync(baseDc, filter);

            if (!searchResults.Any())
            {
                Console.WriteLine($"User {testUserName} not found.");
                
            }

            var userEntry = searchResults.First();
            Console.WriteLine();
            Console.WriteLine($"{testUserName} attributes:");
            Console.WriteLine(string.Join(", ", userEntry.ToDirectoryEntry().Attributes));

            // Now bind as the found user to test password
            await ldapConnection.BindAsync(Native.LdapAuthType.Simple, new LdapCredential
            {
                UserName = userEntry.Dn,
                Password = testPassword
            });

            Console.WriteLine();
            Console.WriteLine($"{testUserName} login success!");
        }
        catch (Exception e)
        {
            Console.WriteLine("LDAP Error:");
            Console.WriteLine(e.Message);
        }

        Console.ReadKey();
    }
    ```

not working

[maliming] said: Great 👍

thanks for your response and support

thanks but it is give me error InvalidOperationException: The partial view '_ValidationScriptsPartial' was not found. The following locations were searched: /Pages/_ValidationScriptsPartial.ar.cshtml /Pages/_ValidationScriptsPartial.cshtml /Pages/Shared/_ValidationScriptsPartial.ar.cshtml /Pages/Shared/_ValidationScriptsPartial.cshtml /Views/Shared/_ValidationScriptsPartial.ar.cshtml /Views/Shared/_ValidationScriptsPartial.cshtml

Showing 1 to 10 of 13 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 10, 2025, 06:30