Open Closed

How to replace built-in Settings -> Identity Management -> Ldap Login Settings component #5924


User avatar
0
bozkan created
  • ABP Framework version: v6.0.3
  • UI Type: Angular
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

I need to add an additional checkbox as "Use LDAPS", so I need to replace ldap settings component. But I could not see this component inside replaceable components lists (eThemeBasicComponents or eThemeLeptonComponents)


6 Answer(s)
  • User Avatar
    0
    IanW created

    Hello Bozkan, can you give us more context on how and who would use this checkbox?

    The area of documentation you are looking for is the settings module, but I need to know more info first.

    https://docs.abp.io/en/abp/latest/Settings#setting-values-in-the-application-configuration

  • User Avatar
    0
    bozkan created

    I need to have a special configuration per tenant, so that the tenant can choose to connect with ldap or secure ldap (ldaps).

  • User Avatar
    0
    IanW created

    Hello Bozkan,

    It seems that LDAP is already an optional feature that can be enabled via checkbox from the Tenant management pages.

    https://docs.abp.io/en/commercial/4.3/modules/account/ldap

    Are you saying you want to have the same functionality, but using LDAPS (Secure)? separate from standard LDAP?

  • User Avatar
    0
    bozkan created

    Yes

    Are you saying you want to have the same functionality, but using LDAPS (Secure)? separate from standard LDAP?

  • User Avatar
    0
    IanW created

    Hello Bozkan, I have discussed this with the team internally and we will bring this functionality to Abp 8.

    For now, I will try to assist you in explaining how to overwrite the existing module with your own LDAP module so that it has these extra settings.

    You need to first get the source code for the LDAP module. The ABP repository has many modules inside it, please download the source, and find the LDAP module. https://github.com/abpframework/abp/tree/dev/framework/src/Volo.Abp.Ldap

    I recommend that since this module is quite small, you just copy and paste the files into your own solution as a separate project. You need to connect it via project reference to your main application - replacing the nuget packages you currently have referenced.

    After this, you can make changes to the LDAP source code here, and it will reflect into your project.

    To add LDAPS, you need to:

    1. Add a setting into the LDAP for a boolean, "Secure" setting definition in this file https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapSettingDefinitionProvider.cs#L42
    2. Update the setting provider so you can actually get the setting https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapSettingProvider.cs
    3. Update the manager to use this setting if it is true for this tenant https://github.com/abpframework/abp/blob/a44fa9c105187bafeaa9fd1a5f53bee23ffdc649/framework/src/Volo.Abp.Ldap/Volo/Abp/Ldap/LdapManager.cs#L59 The code should be something like await connection.BindAsync((await LdapSettingProvider.GetSecureAsync()) ? Native.LdapAuthType.Secure : Native.LdapAuthType.Simple, new LdapCredential()
    4. Finally, you need to update the frontend to include a new checkbox for the Secure boolean setting.
  • User Avatar
    0
    IanW created

    @bozkan if you have no further questions we will close this in a few days. Please let me know

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11