Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAP Security - Don't re-authenticate on every request #10267

Closed
hyperman1 opened this issue Jun 25, 2020 · 3 comments · Fixed by #39665
Closed

LDAP Security - Don't re-authenticate on every request #10267

hyperman1 opened this issue Jun 25, 2020 · 3 comments · Fixed by #39665
Labels
kind/enhancement New feature or request
Milestone

Comments

@hyperman1
Copy link

Description
When using ldap security and servlets, every request/response re-authenticates. Especially the role lookup can take a lot of time. Hence, the elytron cache should be possible to enable

Implementation ideas
The existing io.quarkus.elytron.security.ldap.LdapRecorder class seems a good point for this: The last line is:

      return new RuntimeValue<>(builder.build());

You can do something like:
//These come from application.properties
int config_cache_size=10000;
long config_cache_time_to_live=1000L6015;//15 minutes

            SecurityRealm ldapRealm = builder.build();
	if (ldapRealm instanceof CacheableSecurityRealm&&config_cache_size!=0) {
		// Cache 15 minuten
		ldapRealm = new CachingSecurityRealm((CacheableSecurityRealm) ldapRealm,
				new LRURealmIdentityCache(config_cache_size, config_cache_time_to_live));
	}
            return new RuntimeValue<>(ldapRealm);
@hartimcwildfly
Copy link

Should the caching be fixed at buildtime or at runtime?

@daniel-chelcioiu
Copy link

Hi,
Any news on this ?
Thanks

@hyperman1
Copy link
Author

@hartimcwildfly I think I answered you in another thread or on the chat, so I'll add my answer from long ago here:

In my experience, all security parameters should be tuneable at run time. Security setup can differ between dev and prod, and might be adapted by different teams.

We managed to introduce keycloak in our organisation, so my interest for LDAP has seriously diminished since writing these calls.

@daniel-chelcioiu I don't think there is any other news on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants