Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "pmphillip"

Answer

Perfect, now it's working. Thanks a lot!

Answer

Hi,

thank you very much but it still wont authenticate against ldap. I would really appreciate if you could provide a minimal example of ldap authentication with the module zero. We are evaluating your framework for different projects but the documentation is lacking especially the ldap part. I guess this will improve over time right?

But, actually this is not true. Because it change the setting everytime application starts. You should change it in a some setting page of your application or add seed code to your db migration.

Where and how do I do that? Could you explain little more in Detail please?

SettingManager settingsManager = IocManager.Resolve<SettingManager>(); settingsManager.ChangeSettingForApplication(LdapSettingNames.IsEnabled, "true");

and move these 2 lines to PostInitialize method of your module, not Initialize.

Was this the only change to be made? Or do I also have to adjust Web.config for example? Sorry for so many question, I really appreciate your help.

Best regards

Question

Hello everyone,

is there a complete example of LDAP authentication. I've read the documentation but I can't get it work. It will only authenticate against the mssql database. That's what I already did:

Created Authentication Source Class

class HagebauRzPortalLdapAuthenticationSource : LdapAuthenticationSource<Tenant, User>
    {
        public HagebauRzPortalLdapAuthenticationSource(ILdapSettings settings, IAbpZeroLdapModuleConfig ldapModuleConfig)
        : base(settings, ldapModuleConfig)
        {
           
        }
    }

Then I changed the core module file:

[DependsOn(typeof(AbpZeroCoreModule),typeof(AbpZeroLdapModule))]
    public class HagebauRzPortalCoreModule : AbpModule
    {
     
        public override void PreInitialize()
        {

            Configuration.Modules.ZeroLdap().Enable(typeof(HagebauRzPortalLdapAuthenticationSource));
          //Remove the following line to disable multi-tenancy.
          //Configuration.MultiTenancy.IsEnabled = false;

            //Add/remove localization sources here
            Configuration.Localization.Sources.Add(
                new DictionaryBasedLocalizationSource(
                    HagebauRzPortalConsts.LocalizationSourceName,
                    new XmlEmbeddedFileLocalizationDictionaryProvider(
                        Assembly.GetExecutingAssembly(),
                        "PM.HagebauRzPortal.Localization.Source"
                        )
                    )
                );
           
        }

        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
            SettingManager settingsManager = IocManager.Resolve<SettingManager>();
            
            settingsManager.ChangeSettingForApplication("LdapSettingNames.IsEnabled", "true");

            
        }
    }

Now I get an exception telling me that there is no setting defined with property "LdapSettingNames.IsEnabled" :? What am I doing wrong? Any help would be greatly appreciated.

Best regards, Phillip

Showing 1 to 3 of 3 entries