Closed sysmat closed 2 months ago
What version are you using?
1.2.4 I'm still on java 8(customer cannot move to higher java)
Can you post a code snippet so I can see the usage? (If you're using DefaultLdapEntryManager
, I'm pretty sure that component doesn't support referrals.)
....
public void build(ConfigIntf configApi) {
final Map<String, Object> props = new HashMap<>();
props.put(INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
props.put(PROVIDER_URL, configApi.getLdapUrl());
props.put(SECURITY_AUTHENTICATION, "simple");
props.put(SECURITY_PRINCIPAL, configApi.getLdapUser());
props.put(SECURITY_CREDENTIALS, configApi.getLdapPass());
// ldap cluster has readonly & write nodes so we need this for write operations to work
props.put(REFERRAL, "follow");
props.put("java.naming.ldap.referral.limit", "3");
// https://www.ldaptive.org/v1/
ConnectionConfig connConfig = new ConnectionConfig(configApi.getLdapUrl());
// connConfig.setUseStartTLS(true); if we whant to start TLS but we use ldaps already
this.ldapFactory = new DefaultConnectionFactory(connConfig);
this.ldapFactory.getProvider().getProviderConfig().setProperties(props);
this.ldapConn = ldapFactory.getConnection();
}
public DefaultLdapEntryManager<UserLdap> getManager() {
DefaultLdapEntryMapper<UserLdap> mapper = new DefaultLdapEntryMapper<>();
return new DefaultLdapEntryManager<>(mapper, this.ldapFactory);
}
....
...
try {
this.connBuildr.getManager()
.add(user);
} catch (LdapException e ){ }
I haven't been able to reproduce this yet. Based on your configuration, JNDI should handle the referral transparently. To be clear, are you seeing a success result code or referral result code at the client but no entry added in the server?
@dfish3r thx