Activities of "vijay.nallala"

  • ABP Framework version: v6.0.1
  • UI type: MVC
  • DB provider: MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • AbpValidationException: ModelState is not valid! See ValidationErrors for details. Volo.Abp.AspNetCore.Mvc.Validation.ModelStateValidator.Validate(ModelStateDictionary modelState) Volo.Abp.Account.Public.Web.Pages.Account.LoginModel.OnPostAsync(string action) Volo.Abp.Account.Web.Pages.Account.OpenIddictSupportedLoginModel.OnPostAsync(string action) Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory+GenericTaskHandlerMethod.Convert<T>(object taskAsObject) Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory+GenericTaskHandlerMethod.Execute(object receiver, object[] arguments) Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync() Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync() Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context) Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()
  • Steps to reproduce the issue:" *created application MVC Tierd and run the auth project getting below error with passing username and password.

i have tried with three theme, also downgrade with 6.00 getting same issue

Please refer same issue - https://github.com/abpframework/abp/issues/12320

all protected virtual must be public so that we can override which methods/props. it doesn't make sense making as protected

@maimling - why it closed I am asking the override functionality your referring the extension. please advise

added more info

to more clear see bloew we need to override auth and localization props. please suggest

  • ABP Framework version: v5.3.3
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

I am referring below

https://support.abp.io/QA/Questions/3235/Override-abpapplication-configuration-api

#3235 I could not find public method that can be override some data.

below we are trying reduce load not load all auth data. some auth not required for gatewayapi level.

lets say if request coming from internal api1 -- auth should load only api1 data and send api1 - app configuration, same for api2 . but using micro service app configuration giving all service data which we need apply filter based on resource or scope.

Answer

For --admin/host auth below bindasync 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,
});

For - user auth below bindasync await ldapConnection.BindAsync(LdapAuthType.Simple, new LdapCredential { UserName = userEntry.Dn, Password = testPassword, });

i would need two method in abp??

Answer

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&lt;LdapManager&gt;.Instance;
}

public virtual async Task&lt;bool&gt; 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&lt;ILdapConnection&gt; 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
    });
}

}

Answer

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.

Showing 1 to 10 of 47 entries
Made with ❤️ on ABP v9.1.0-rc.1. Updated on January 17, 2025, 14:13