spring-securityspring-security-ldap

Performing Poorly org.springframework.security.authentication.ProviderManager.authenticate(Authentication)


I am trying to figure out why this is performing so poorly:

execution(Authentication org.springframework.security.authentication.ProviderManager.authenticate(Authentication)) -> 
ELAPSED_TIME="592 ms"

I am using a org.springframework.security.ldap.authentication.LdapAuthenticationProvider;

What can I log/capture to see why this is taking so long?

Thanks, Brian


Solution

  • Since you are using LDAP authentication on first authenticate request that authentication must be verified against LDAP server (thats why it take so long for first request). I dont know exactly how LDAP Works but it seems that subsequent requests also have to be verified against server but already with some type of cache on LDAP server Side (thus faster response times).

    Please see this thread: Slow authentication to LDAP Server on initial login attempt