You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you know how to fix the issue, make a pull request instead.
I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions, such as how to use the library, there).
I believe this is an issue in this library and not in the underlying libraries ldapjs or ldapauth-fork. (This library is a passport strategy and does not implement the LDAP communication)
Note: if the issue template is not used, the issue will be closed.
Problem Description
ldapauth-fork accepts a boolean flag called cache. passport-ldapauth does not allow this flag to be processed as it creates a new instance of LdapAuth every single time. This PR allows for caching of LDAP responses when options are passed as an object to Strategy's constructor. It creates a new instance when options is a function.
Steps to Reproduce
set cache: true in options. ldapauth-fork will still make a call to the LDAP server for the same username. Ideally it should cache for 5 minutes.
The text was updated successfully, but these errors were encountered:
@vesse I could raise a PR for this. Any chance you might be able to provide some guidance on how to approach it? It looks like we need to reuse LdapAuth instances as opposed to creating new instances every time.
The reason for recreating the LdapAuth instance was originally (years ago) because after some time of not using the connection it got disconnected and there was no option to reconnect automatically. Now some good people of Internet have added reconnection support to ldapauth-fork which could mean that it could be possible to reuse the instance.
Unfortunately I haven't been working for a project with LDAP authentication for years so I don't have possibilities to try this in real life situation, but I'd suggest enabling reconnection and then just see if reusing the connection works also after a long inactivity.
If you know how to fix the issue, make a pull request instead.
Note: if the issue template is not used, the issue will be closed.
Problem Description
ldapauth-fork accepts a boolean flag called cache. passport-ldapauth does not allow this flag to be processed as it creates a new instance of LdapAuth every single time. This PR allows for caching of LDAP responses when options are passed as an object to Strategy's constructor. It creates a new instance when options is a function.
Steps to Reproduce
set cache: true in options. ldapauth-fork will still make a call to the LDAP server for the same username. Ideally it should cache for 5 minutes.
The text was updated successfully, but these errors were encountered: