-
Notifications
You must be signed in to change notification settings - Fork 445
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
Fix auth in UI with LDAP if password authentication is disabled #3912
Conversation
@minurmin : This has some |
… auth method is present
3d5658c
to
83d86d7
Compare
Ok, it should pass lint validation now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks @minurmin ! I reviewed and tested this today, and verified it works. It's perhaps not the perfect solution (as it requires some extra logic to check which auth methods are enabled specific to LDAP), but it seems "good enough" because it solves the immediate bug.
So, I'm going to go ahead and merge this & port to 8.x and 7.x
Successfully created backport PR for |
Successfully created backport PR for |
References
Description
If LDAP authentication is enabled but Password authentication is not, Angular UI shows a blank login dialog. This PR fixes the issue by forcing Password dialog to be present (as the same password dialog is used in both password- and ldap-based authentication) as part of the enumeration and sorting of login methods.
Instructions for Reviewers
Details on functionality: When enumerating the authentication methods for sorting, additional local variables to record whether password auth and/or ldap auth are present. In the special case where ldap auth is present and password auth is not, password auth is added anyway. This is needed because there is no renderAuthMethodFor decorator related to ldap auth (and overall, ldap auth is barely referenced anywhere outside the auth.method.ts as the UI is the same for password authentication). Because of the new variables the form will appear only once compared to the situation where a decorator would be present both password and ldap auth (as mentioned in discussion of #2701).
So far, the code has only been tested with DSpace 7.6.x. However, there seems to be no essential changes in auth.interceptor.ts after introducing the reordering functionality #2414 so it's at least mergeable to main branch as well.
Steps to test the issue (i.e. adjusting values of plugin.sequence.org.dspace.authenticate.AuthenticationMethod in DSpace server settings) are described in DSpace/DSpace#8312
Checklist
main
branch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lint
npm run check-circ-deps
)