Dan Tanner
Dan Tanner

Reputation: 2444

grails-spring-security-ldap plugin configure LDAP connect timeout

I'm trying to configure the LDAP connect timeout with the grails-spring-security-ldap plugin (version 2), and can't find the correct configuration.

e.g. With this configuration:
grails.plugin.springsecurity.ldap.context.server = "ldaps://host1 ldaps://host2"

I've been testing the scenario where host1 is unavailable, expecting that the connect timeout will be what I've configured. The symptom is two things:
1. The server takes about an additional 3 minutes to start up. i.e. It waits for minutes on the LDAP configuration step before failing over to host2.
2. Login attempts appear to have a failover timeout of about 10 seconds.
So I'm presuming my configuration attempts aren't being applied.

I've tried both of these without success:
1. Config.groovy value: grails.plugin.springsecurity.ldap.context.baseEnvironmentProperties = ['com.sun.jndi.ldap.connect.timeout': '2000']
2. startup env property: -Dcom.sun.jndi.ldap.connect.timeout=2000

Ideas on what I'm doing wrong?

Upvotes: 1

Views: 477

Answers (1)

MarquisDeMizzle
MarquisDeMizzle

Reputation: 514

Your initial instincts were right, your solution #1 from above works: grails.plugin.springsecurity.ldap.context.baseEnvironmentProperties = ['com.sun.jndi.ldap.connect.timeout': '2000']

I'm using the 2.x branch of the plugin (2.0.1 to be exact) on Grails 2.5.4 in a similar situation to yours, though I have 3 servers. I think you may have been one small grails clean away from success, as it didn't work initially for me either. After a clean it works perfectly. I can induce timeouts with some /etc/hosts fiddling and altering the Config.groovy timeout value produces the expected results, cascading across the servers on timeout.

Upvotes: 1

Related Questions