mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 08:15:52 +03:00
[GH-ISSUE #287] Self registration with invite code? #107
Labels
No labels
backend
blocked
bug
cleanup
dependencies
docker
documentation
duplicate
enhancement
enhancement
frontend
github_actions
good first issue
help wanted
help wanted
integration
invalid
ldap
pull-request
question
rust
rust
tests
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lldap-lldap#107
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @poVoq on GitHub (Aug 20, 2022).
Original GitHub issue: https://github.com/lldap/lldap/issues/287
Would it be possible to have the option in the webinterface to allow users to register themselves with an invite code?
Invite codes could be permanent or time/number-limited?
Maybe users could even be allowed to generate their own invite codes?
@poVoq commented on GitHub (Jan 25, 2023):
While this would be still nice to have in LLDAP, there is this relatively simple php app that can provide this functionality:
https://github.com/matheusfillipe/ldap-signup
the
special-authbranch is slightly modified to work with invite-codes.I will probably test it more in the coming days and provide a working configuration for the LLDAP documentation.
Somewhat related is the awesome Canaille app: https://gitlab.com/yaal/canaille which allows managing LDAP users and groups with invites and also has an additional Oauth2 endpoint (similar to Keycloak, but much less complex). It also does not support self-registration yet, but can be a great companion to LLDAP never the less I think (I need to actually test it with LLDAP).
@pixelrazor commented on GitHub (Mar 16, 2023):
Looking at maybe taking this up after the yew upgrade.
I'm imagining that we can use tokens nearly identically to password reset (if not using the same model/table) where that token is deleted when used and we generate a short lived cookie for that one endpoint (a new endpoint created for this).
This leaves the UI changes. It should only be visible to admin since that's the only group with write privilege. This could potentially be a new menu item in the navbar along 'users' and 'groups'? From there, it could be either or both of:
2 feels a bit redundant to me - while we COULD prefill the email in the creation form, i think it should be kept open for users to use a different email than the one it was sent to.
I feel like there COULD be an argument for wanting the ability to make a link that also adds the new user to certain groups, but i don't think that's really the best idea, and the admin can easily add them after creation.
Then of course we'll need a new endpoint for the creation page. This could be pretty much the same as the current user creation page - there could ideally be a way we share that part of the frontend with some refactoring of that component
@nitnelave commented on GitHub (Mar 16, 2023):
Sounds good! I agree with the overall approach. A couple of points:
@nitnelave commented on GitHub (Mar 16, 2023):
Oh, and regarding adding the user to certain groups, that could be added later on by making that a property of the invitation: in the invitation list screen, the admin would have a way to add groups to the invitation, that will then be added to the user on account creation.
@pixelrazor commented on GitHub (Mar 16, 2023):
Would this end up being specific to this path, or should that also become part of the process when an admin creates a user?
re: adding to groups - i still think it'd be bbetter to have the admin control groups manually AFTER account creation instead of having it attached to the creation link. That being said i can't seem to form a solid argument so i'll sway to whatever way you prefer.
SSome of these requirements are enough to warrant a different model for these tokens since we've deviated a bit from the password reset tokens. I'll have to do enough investigating to ensure it can be done without (hopefully) breaking previouus versions.. IIRC isn't there some breaking db migration planned at SOME point in time TBD?
@nitnelave commented on GitHub (Mar 16, 2023):
Let's leave email confirmation out of the picture for now. It's not needed for now, and we can always come back to the question.
Same for adding to groups, as long as we have the email on user creation, the admin can add it manually after the creation.
The current tokens for the password reset are 100 random (ascii) characters, I wouldn't really call that a "model" :D
W.r.t. the DB, we have some DB migrations built into LLDAP that are run on startup to make sure the DB is up to date (see the sql_migrations.rs file). Adding a new table is not a breaking change.
@nitnelave commented on GitHub (Mar 16, 2023):
We'll have to be careful and use transactions when checking for the token's validity, removing it and creating the user at the same time.
@nitnelave commented on GitHub (Mar 20, 2023):
I was thinking back on this feature, and compared to creating the account directly for the user, the only thing that changes is that the user is able to pick their username. That doesn't seem worth the extra complexity.
@poVoq commented on GitHub (Mar 20, 2023):
Its a completely different use-case. If you want to run a semi-public service you can't manually create accounts all the time. But anyway... there are ways to achieve this without having it built into LLDAP directly, so not a big deal.
@pixelrazor commented on GitHub (Mar 20, 2023):
You'll be manually creating links and sending them out anyways, and have to deal with the security implications depending on how you distribute them.
@poVoq commented on GitHub (Mar 20, 2023):
In my original feature request I was rather thinking about shared (time/number limited) invite codes, so that would not require manual intervention except for making these shared invite codes from time to time.