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

WIP: Ldap authentication #146

Closed
wants to merge 94 commits into from
Closed

Conversation

ibiBgOR
Copy link

@ibiBgOR ibiBgOR commented Oct 2, 2020

I tried to implement a possibility to configure the login via LDAP.

The current state is:

  • It is possible to login (new users) into the system
  • The user get the correct permissions by LDAP group (superuser, active, staff)
  • It is now possible to simply add more authentication providers (with or without existing library)

Currently absolutely missing:

  • Prevent LDAP users from trying to change the password
  • Therefor it is necessary to include an extra field within the database to mark an user as "external" (or something like that)

Nice to haves/missing for the future:

  • Furthermore it would be nice to show all groups available within the LDAP for the permissions (one could import all the groups into the django local environment, but the authors of the django-auth-ldap lib discurage this behaviour (see: Group Mirroring))

I'm sorry to not further discuss my changes on the referenced issue but if you have any feedback I'll try to look into them!

The general LDAP login is enabled and can be used.
To enable further functionality it was necessary to split
the different login mechanisms into separate files.
To use the new LDAP login method it is necessary to be able to
configure it via the papermerge.conf.py file.
@ciur
Copy link
Owner

ciur commented Oct 2, 2020

@ibiBgOR, hey man, fantastic work!
Thank you so much!

I will keep your PR in queue for two weeks; thus you can safely push further changes.
The reason is that I plan to have 1.5 release in two weeks and I am currently working on last mile testing -> I won't add major changes in next two weeks.
LDAP authentication was planned for 1.6 release, thus your changes are just in time! So once 1.5 is out (in two weeks) I would proceed with your PR.
Please don't forget to regularly sync with (i.e. pull from) master branch.

ibiBgOR and others added 25 commits October 3, 2020 12:18
The build fails, because no module for django_auth_ldap could
be found. To resolve this issue, we now require the user to
explicitly configure the AUTH_MECHANISM or use NodeAuthBackend
as default.
NodeAuthBackend is also the fallback if LDAP was configured
but the required packages were not installed. This way the
software will always run but the user can see within the logs
that some problem occured.
Sadly I started implementing the import of the usersource
into the database but forgot about removing the code within
the LdapAuthBackend.
This should fix the issue that the build fails.
As LDAP users should be altered within the LDAP itself
the application should not be allowed to change any data.
ciur and others added 27 commits October 16, 2020 18:29
As LDAP users should be created within the LDAP itself
the application should not be allowed to add any new user.
This way even groups can be imported form external authentication sources.
Furthermore this commit removed access to ui-elements depending on user permissions.
The permissions can be given not only user wise but also group wise. This way
it is possible to create an "administration" group which is able to administer
the application (managing users and groups)
Not every user needs to be able to check the users visible to the system or all
the groups available within the system.
Not only will all interfaces be empty for said users (with no permissions) but
the menu entries will be deleted from the menubar.
To better match the overall layout it is necessary to have a consistent layout
throughout the application. Therefore some interfaces were required to change
accordingly.
Now pretty much all "administrative" interfaces look the same.
…_authentication

� Conflicts:
�	papermerge/__init__.py
�	papermerge/core/backup_restore.py
�	papermerge/core/models/document.py
�	papermerge/core/views/users.py
�	papermerge/test/test_backup_restore.py
�	papermerge/test/test_page.py
�	papermerge/test/test_search.py
@ciur
Copy link
Owner

ciur commented Apr 6, 2021

no activity

@ciur ciur closed this Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants