LDAP Storage Provider Extension mappers tab missing

Hi!

I have a question related to the LDAPStorageProviderFactory extension, why my custom provider does not show the Mappers tab that will allow me to add ldap mappers to my custom provider?

I have extended the LDAPStorageProviderFactory and LDAPStorageProvider classes in order to override the removeUser method. However, when using a new LDAP provider using this custom provider, the Settings tab labels are not being displayed properly and the mappers tab is entirely missing. Here is what I am experiencing:

And these are my two classes extending Keycloak LDAP Provider and Factory:

public class CustomLDAPStorageProvider extends LDAPStorageProvider{

public CustomLDAPStorageProvider(LDAPStorageProviderFactory factory, KeycloakSession session, ComponentModel model, LDAPIdentityStore ldapIdentityStore) { super(factory, session, model, ldapIdentityStore); _session=session; }

public class CustomLDAPStorageProviderFactory   extends LDAPStorageProviderFactory implements UserStorageProviderFactory<LDAPStorageProvider>{
public static final String PROVIDER_ID = "Custom-ldap-provider";
	private static final Logger _logger = Logger.getLogger(CustomLDAPStorageProviderFactory.class);
	private Config.Scope _config;
	private ComponentModel _componentModel;
	private LDAPIdentityStoreRegistry _ldapStoreRegistry;
	@Override
	public String getId() {
		_logger.debug("CustomLDAPStorageProviderFactory getId");
		return PROVIDER_ID;
	}
	@Override
	public CustomLDAPStorageProvider create(KeycloakSession session,ComponentModel model ) {
		 Map<ComponentModel, LDAPConfigDecorator> configDecorators = getLDAPConfigDecorators(session, model);
	        LDAPIdentityStore ldapIdentityStore = this._ldapStoreRegistry.getLdapStore(session, model, configDecorators);
	        return new CustomLDAPStorageProvider(this, session, model, ldapIdentityStore);
	}
	@Override
	public void init(Config.Scope config) {
		this._ldapStoreRegistry = new LDAPIdentityStoreRegistry();
	}}

Any feedback please? It would be greatly appreciated! How to make this custom provider be identified as an LDAP provider so that the Mappers tab is shown as well? I am using Keycloak version 26.3.1 Quarkus Distribution. Thank you so much

Do you need to use it at the same time as the standard LDAP provider? I’m wondering if giving it the same provider ID as the built-in provider would cause the UI to render the mappers.

However, keep in mind that the built-in functionality in Keycloak has a bunch of custom/conditional admin UI that is not available to extensions.

Hi!

Thank you so much for the advice. What you suggested makes sense, I have actually tried it and it works! Thank you xgp!
@OverrideOverride

public String getId() {

  return "ldap";

}

Additionally you also should implement the order() method and return a higher value than the default one, otherwise it’s not guaranteed that your custom provider is loaded after the default one.
This is also mentioned in the docs!