mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-05 00:29:48 +03:00
Add the option to disable the default Email/Password authentication option #882
Open
opened 2026-02-04 22:41:24 +03:00 by OVERLORD
·
21 comments
No Branch/Tag Specified
development
l10n_development
further_theme_development
release
llm_only
vectors
v25-11
docker_env
drawio_rendering
user_permissions
ldap_host_failover
svg_image
prosemirror
captcha_example
fix/video-export
v25.12.3
v25.12.2
v25.12.1
v25.12
v25.11.6
v25.11.5
v25.11.4
v24.11.4
v25.11.3
v25.11.2
v25.11.1
v25.11
v25.07.3
v25.07.2
v25.07.1
v25.07
v25.05.2
v25.05.1
v25.05
v25.02.5
v25.02.4
v25.02.3
v25.02.2
v25.02.1
v25.02
v24.12.1
v24.12
v24.10.3
v24.10.2
v24.10.1
v24.10
v24.05.4
v24.05.3
v24.05.2
v24.05.1
v24.05
v24.02.3
v24.02.2
v24.02.1
v24.02
v23.12.3
v23.12.2
v23.12.1
v23.12
v23.10.4
v23.10.3
v23.10.2
v23.10.1
v23.10
v23.08.3
v23.08.2
v23.08.1
v23.08
v23.06.2
v23.06.1
v23.06
v23.05.2
v23.05.1
v23.05
v23.02.3
v23.02.2
v23.02.1
v23.02
v23.01.1
v23.01
v22.11.1
v22.11
v22.10.2
v22.10.1
v22.10
v22.09.1
v22.09
v22.07.3
v22.07.2
v22.07.1
v22.07
v22.06.2
v22.06.1
v22.06
v22.04.2
v22.04.1
v22.04
v22.03.1
v22.03
v22.02.3
v22.02.2
v22.02.1
v22.02
v21.12.5
v21.12.4
v21.12.3
v21.12.2
v21.12.1
v21.12
v21.11.3
v21.11.2
v21.11.1
v21.11
v21.10.3
v21.10.2
v21.10.1
v21.10
v21.08.6
v21.08.5
v21.08.4
v21.08.3
v21.08.2
v21.08.1
v21.08
v21.05.4
v21.05.3
v21.05.2
v21.05.1
v21.05
v21.04.6
v21.04.5
v21.04.4
v21.04.3
v21.04.2
v21.04.1
v21.04
v0.31.8
v0.31.7
v0.31.6
v0.31.5
v0.31.4
v0.31.3
v0.31.2
v0.31.1
v0.31.0
v0.30.7
v0.30.6
v0.30.5
v0.30.4
v0.30.3
v0.30.2
v0.30.1
v0.30.0
v0.29.3
v0.29.2
v0.29.1
v0.29.0
v0.28.3
v0.28.2
v0.28.1
v0.28.0
v0.27.5
v0.27.4
v0.27.3
v0.27.2
v0.27.1
v0.27
v0.26.4
v0.26.3
v0.26.2
v0.26.1
v0.26.0
v0.25.5
v0.25.4
v0.25.3
v0.25.2
v0.25.1
v0.25.0
v0.24.3
v0.24.2
v0.24.1
v0.24.0
v0.23.2
v0.23.1
v0.23.0
v0.22.0
v0.21.0
v0.20.3
v0.20.2
v0.20.1
v0.20.0
v0.19.0
v0.18.5
v0.18.4
v0.18.3
v0.18.2
v0.18.1
v0.18.0
v0.17.4
v0.17.3
v0.17.2
v0.17.1
v0.17.0
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.3
v0.15.2
v0.15.1
v0.15.0
v0.14.3
v0.14.2
v0.14.1
v0.14.0
v0.13.1
v0.13.0
v0.12.2
v0.12.1
v0.12.0
v0.11.2
v0.11.1
v0.11.0
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.2
v0.8.1
v0.8.0
v0.7.6
v0.7.5
v0.7.4
v0.7.3
0.7.2
v.0.7.1
v0.7.0
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
Labels
Clear labels
🎨 Design
📖 Docs Update
🐛 Bug
🐛 Bug
:cat2:🐈 Possible duplicate
💿 Database
☕ Open to discussion
💻 Front-End
🐕 Support
🚪 Authentication
🌍 Translations
🔌 API Task
🏭 Back-End
⛲ Upstream
🔨 Feature Request
🛠️ Enhancement
🛠️ Enhancement
🛠️ Enhancement
❤️ Happy feedback
🔒 Security
🔍 Pending Validation
💆 UX
📝 WYSIWYG Editor
🌔 Out of scope
🔩 API Request
:octocat: Admin/Meta
🖌️ View Customization
❓ Question
🚀 Priority
🛡️ Blocked
🚚 Export System
♿ A11y
🔧 Maintenance
> Markdown Editor
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/BookStack#882
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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 @tuaris on GitHub (Oct 25, 2018).
Describe the feature you'd like
Disable Registration form but keep the ability to use Social Registration only.
Describe the benefits this feature would bring to BookStack users
Forces the use of more secure authentication processes.
Additional context
Example: Google SSO is enabled and the administrator would like to enforce users to utilize Google SSO instead of local auth. Currently Bookstack's login and registration forms will have fields to enter username's/email and password in addition to the Social Login button.
The administrator should have an option to 'turn off' those fields and have only the social login/registration options available.
BONUS: The login and signup links can automatically use social login/register if there is only one enabled. Or the admin can set a preferred one if multiple are enabled.
@tuaris commented on GitHub (Oct 25, 2018):
I currently 'hack' this using CSS
@HitomiTenshi commented on GitHub (Nov 5, 2018):
I second this. I only allow login through our GitLab instance.
As a current workaround I use the following
Custom HTML head contentsetting:Results in a clean login view:
@pacroy commented on GitHub (Nov 9, 2018):
Here is how you disable the form on registration page:
@HitomiTenshi commented on GitHub (Nov 9, 2018):
@pacroy Your style doesn't disable the registration, it only removes the registration form from the DOM.
If you want to properly disable user registration you should disable it in the settings page:
@pacroy commented on GitHub (Nov 9, 2018):
@HitomiTenshi I want to allow registration only thru the 3rd-party and disable the build-in one.
@HitomiTenshi commented on GitHub (Nov 9, 2018):
@pacroy See Automatic Registration & Email Confirmation in the Third Party Authentication page.
You'll have to edit your
.envfile to include this line:Replace
{SERVICE}with your 3rd-party authentication service, e. g.:That way you can disable standard registration (email / password) in the settings and use the 3rd-party sign in button to automatically register the user. The user needs to confirm his email, but you can disable that as well and automatically accept the email provided by the 3rd-party authentication by adding another line to your
.envfile:Replace
{SERVICE}with your 3rd-party authentication service, e. g.:The only thing that will remain is the standard login using email / password which I currently have to remove using the style I provided in my comment above.
@ssddanbrown commented on GitHub (Nov 10, 2018):
Thank you very much @HitomiTenshi for your detailed instructions and work-arounds above.
@tuaris I've updated the title to be more specific of what needs to be implemented since the request in the previous title was already possible via the instructions posted above. Let me know if I'm mistaken though.
Implementation Notes
The following areas will need to updated to incorporate such a change:
@HitomiTenshi commented on GitHub (Nov 10, 2018):
@ssddanbrown "Forgot password" should be disabled, because it's clearly part of the standard email / password authentication. I would be confused seeing the forgot password flow on a site which I used 3rd-party authentication on.
@ssddanbrown commented on GitHub (Nov 10, 2018):
@HitomiTenshi Thanks for confirming that thought. I've updated my comment above to remove the question mark from that point.
@pacroy commented on GitHub (Nov 10, 2018):
@HitomiTenshi Thanks for that's very useful.
My scenario is:
Everything works fine now except user can change their email address in their profile. Is there a way to prevent from changing the email address?
@HitomiTenshi commented on GitHub (Nov 10, 2018):
@pacroy Currently there is no way to prevent the user from changing their email address. This could be a useful feature when using 3rd-party authentication. Although when the user changes their email in the 3rd-party site, it has to be synced somehow with bookstack.
I'd suggest creating a new issue for your feature reqeust "Prevent the user from changing their email when using OAuth".
@gandarez commented on GitHub (Feb 20, 2019):
Need this feature either
@nmehlei commented on GitHub (May 17, 2019):
Definitely would be useful as I have to keep reminding my users to use the button at the bottom and not the (more obvious / larger) login form.
@prolane commented on GitHub (Nov 22, 2019):
If you sign in using an Oauth provider, you can't change your email address already, right? At least thats what I see using Google login.
Anyway, I'm looking forward to this feature as well. Its not just the password login and the 'forgot my password' options that would need switching off. Its also the ability to set a password on their profile page.
Thanks in advance!
@gbuckingham89 commented on GitHub (Nov 24, 2021):
Hey @ssddanbrown!
I work for a web agency (local-ish to you, we're down in Bournemouth) and we recently stumbled across BookStack and are hoping to deploy it on behalf of one of our clients. They have some stricter than normal security requirements - and forcing social logins only (Google & Microsoft) is one of those.
It looks like this issue has been open for some time without much recent activity.
If we're in a position to do the work required and submit a PR, would you be wiling to merging such a PR?
Do you have any thoughts / opinions on how this should be implemented - or are you open to suggestions?
Thanks.
@ssddanbrown commented on GitHub (Nov 24, 2021):
Hi @gbuckingham89, Yeah, I have no real desire to work on this myself but I would accept a suitable PR request for such feature.
I'd generally want any implementations to be relatively option/logic-branch free, and simple, to ease maintenance. The only thing I'd expect should be required is setting
AUTH_METHOD=""in the.envfrom an instance admin perspective (Or something along those lines). The trouble I've had before is thinking about recovery scenarios (How does a user or admin recover access if no other login option is present) where needed. Just edge cases like that need to be thought about. Ideally I'd want tests added within the PR.@androbey commented on GitHub (Jan 11, 2022):
Hi all,
just wanted to add another small workaround to hide normal login form using the theme system. Maybe someone will find it useful.
Using the visual theme system you could override
login.blade.php.For example your updated component could wrap the form include in an if statement.
This hides the normal login form, but allows e.g. admin to still login via email/password if they specify URL param "form" ("https://mybookstack.com/login?form=1").
@kelvinq commented on GitHub (Jan 23, 2022):
Inspired by @pacroy, to ensure that users only use Google for registration and authentication/login, I added the following lines in "Custom HTML Head Content":
`<style>
form[action$="register"] {
display: none;
}
form[action$="login"] {
display: none;
}
</style>`
Just in case this is helpful for you.
@cody0704 commented on GitHub (Nov 8, 2022):
Use your settings and cooperate with Nginx's settings to disable account and password login perfectly
Through the Nginx access log, it is found that the account and password login is through POST, while the third-party social login only uses GET
So I disabled login POST via Nginx
After testing, it is confirmed that the account and password login will return http code 444, and the third-party social login is normal.
@jhaisley commented on GitHub (Jan 28, 2023):
You may want to update this to code http 405, which would mean that POST isn't allowed but GET is fine.
@e3ndr commented on GitHub (Jun 6, 2023):
We use bookstack for internal company documentation (and it's great!), we've disabled registrations and I added the following custom head content to hide the email/password form from the login page: