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

[FEATURE] Multiple Simultaneous LDAP Authentication Requests with 2FA #39

Open
bluemellophone opened this issue May 10, 2023 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@bluemellophone
Copy link

bluemellophone commented May 10, 2023

We are using your middleware between the browser and restricted HTML content. Suppose the authentication cookie expires while the browser has old HTML content from before the expiration. In that case, the browser may initiate a cascade of layered authentication requests to the same protected endpoint for various assets (fresh HTML + updated versions of cached files + images). When this happens, the LDAP authentication is triggered for each asset simultaneously.

This is not an urgent problem for basic LDAP deployments, but more advanced setups with two-factor authentication (e.g., Duo) can subsequently trigger several simultaneous alerts and their required 2FA notifications.

Is there a way to sequence multiple requests to the same LDAP resource before successful or failed authentication, where any pending requests for the same client or requesting IP inherit the decision of whichever LDAP response is received first? The issue we are experiencing is a single browser refresh will trigger a dozen LDAP requests and, therefore, a dozen layered 2FA notifications in less than a second.

@wiltonsr wiltonsr added the enhancement New feature or request label May 15, 2023
@wiltonsr wiltonsr changed the title Multiple Simultaneous LDAP Authentication Requests with 2FA [FEATURE] Multiple Simultaneous LDAP Authentication Requests with 2FA May 15, 2023
@wiltonsr wiltonsr added the help wanted Extra attention is needed label May 15, 2023
@wiltonsr
Copy link
Owner

@fcinqmars, What do you think about this feature?

@fcinqmars
Copy link
Collaborator

fcinqmars commented Jul 31, 2023

Could probably be added. I would probably lock on the LDAP resource and client info on re-auth to hold the concurrent requests until the authorization decision is made. Some sort of locking cache could work.

If the session cookie is valid, no need to lock/hold, so performance shouldn't really be affected.

I think the challenge will be to determine what client info we want to use. If the clients are behind a NAT or if Traefik is behind a proxy or Docker, the client IP might not be all that reliable.

@Bremma
Copy link

Bremma commented Jun 5, 2024

Will add on that this issue has been affecting the use of this plugin for me. We are using FreeIPA with OTP and I am using ldapauth with Traefik to host a loadbalancer to a set of Kibana instances.

I have been able to work around this with a combination of a longer cacheTimeout period, and by advising users to access the base load balancer page (eg dev-lb.system.corp.com, not dev-lb.system.corp.com/) when authenticating or re-authenticating (eg the token has timed out and the user is prompted for a new authentication).

Will be keeping an eye on this and can help test on my systems as able!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants