mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-26 01:35:54 +03:00
[GH-ISSUE #2146] Admin-Invited users can only use mailed link to register - bug or feature? #1173
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#1173
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 @fashberg on GitHub (Dec 12, 2021).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/2146
Subject of the issue
Hey! Thanks for this great project!
I have one issue: if a user was invited (through /admin or using vaultwarden_ldap) he cannot register from scratch using web-vault function "create account" (message: "Account with this email already exists").
The user has to use the link from emailed invitation.
Also there is no possibility to resend the invitation mail (admin panel says "User already exists")
Is this intended?
Deployment environment
vaultwarden version: main
Install method: built from source
Clients used: web vault
Reverse proxy and version: none
Steps to reproduce
Expected behaviour
Users should be able to register.
Actual behaviour
No possibility to register without having the invitation
Troubleshooting data
The code checks at accounts.rs if the account is already created completely (!user.password_hash.is_empty() ), then checks for an invitation.
But the invitations are not saved with mail_enabled()
So checking for an active invitation fails.
This patch would resend an invitation if the user tries to register.
Or just "_ => user" to silently create the new user.
What do you think?
Kind regards
Folke
@BlackDex commented on GitHub (Dec 12, 2021):
If you have mail enabled then you need to use the link in the mail.
This is how it is supposed to work.
Same goes for Org invites, they only work by clicking on the link received in the mail.
If you do not have mail enabled, then there are some other steps which are followed.
I think a re-invite button in the admin would be a better way to go then sending out the e-mail again.
Also, i'm not sure if this will work at all, since the invite will create the user again, so that will probably cause an error also.
@fashberg commented on GitHub (Dec 12, 2021):
Hey @BlackDex ,
so what's the main goal of invitations then? (Not speaking about org-invites, but the general onboarding invite).
If a user clicks on Join in the invitation mail and creates account, he has to verify it's e-mail afterwards.
The mail-address is now double verified.
Not invited users can just signup without clicking the link (if enabled).
Wouldn't it be userfriendly:
Kind Regards
Folke
@fashberg commented on GitHub (Dec 12, 2021):
This adds auto-verify when user joins mail invitation (token already checked)
@BlackDex commented on GitHub (Dec 12, 2021):
The main goal is that you can disable signups fully so that nobody can invite them selfs if you have your Vaultwarden server running on the Internet.
Inviting users via the admin interface makes it so that you can still invite people, even though signups are disabled.
The same goes for org invites, you can still allow those, but have random signups still disabled.
Via both ways you need to use the provided link received via the mail. Or if the mail is disabled, then it is a bit less secure, since then anybody who knows there is an invite pending for a specific mail address could create an account.
E-Mail validation is not mandatory, but there could be something said for automatically having it verified if a user does use the link to create an account. That said, Bitwarden does the same thing. Even though an invite is sent per mail, a user still needs to verify there mail address after they created an account. Since we try to keep as close as possible to the same flows i think this still is the best way to go (until they changed it too). It does give some extra sense of security,
@fashberg commented on GitHub (Dec 12, 2021):
If signups are fully disabled this line would not match
So no user can register if prohibited.
If everything should be identical to bitwarden then you have to add the payment process ;)
Why not being better in some situations?
I want to invite all our employees (using vaultwarden_ldap) to make things easier for them. But things are getting more complicated when they are not longer allowed to register the old way and resetting/reinviting has to be done by admins.
@BlackDex commented on GitHub (Dec 12, 2021):
I said we try to keep as close as possible, not identical.
Well, if they need to be able to register, they should have received a mail, and they can use the link.
Else i suggest to use the
SIGNUPS_DOMAINS_WHITELISTgithub.com/dani-garcia/vaultwarden@d0bf0ab237/.env.template (L187-L189)Which is what that specific line you pasted above is checking for including some other checks.
Then you can just send a mail to employees@my-company.tld and just point them towards the Vaultwarden domain where then can register.
I also do not see the reason to resend a mail which they should have gotten already. Then they just need to check there mailbox again and link on the right link.
Also, that you are allowed to disable signups, but still invite them your self, and to allow signups for specific domains is already extra features which Bitwarden doesn't provide at the moment.
@fashberg commented on GitHub (Dec 12, 2021):
sure, i've already have set up this option ;)
I've invited now 60 users with ldap. 40-50 will sign up the next week (hopefully) and the other 10-20 will come to IT support next year saying "i cannot register, i get 'account already exists'"
No prob for me, i've created now my own container with both above listed code-suggestions and will git pull further upstream changes.
Thanks and kind regards!