feat: #1007 - Option to disable local login when OIDC is enabled - #1020
Open
DerDummePunkt wants to merge 1 commit into
Open
Conversation
disable local login when OIDC is enabled - Add GOTIFY_LOCALAUTH_ENABLED, defaulting to true - Block local login and Basic Auth when disabled - Expose local auth state to the UI and hide local login flows - Skip default local admin creation when local auth is disabled - Require either local auth or OIDC at startup
jmattheis
requested changes
Aug 5, 2026
jmattheis
left a comment
Member
There was a problem hiding this comment.
Looks good so far. I've some remarks and haven't tested it manually.
Comment on lines
+150
to
+152
| if !a.LocalAuthEnabled { | ||
| return authStateSkip, nil | ||
| } |
Member
There was a problem hiding this comment.
Instead of skipping this should error and abort.
- Create a new authState named authStateAuthDisabled
- Return 403 with the message "local authentication is disabled" in the evaluate method.
|
|
||
| g.Group("/user").Use(authentication.Optional).POST("", userHandler.CreateUser) | ||
|
|
||
| g.POST("/auth/local/login", sessionHandler.Login) |
Member
There was a problem hiding this comment.
This endpoint should still be registered. 404 seems like a weird response. It should instead return 403 with message "local authentication is disabled"
Comment on lines
+88
to
+90
| if !conf.LocalAuthEnabled && !conf.OIDC.Enabled { | ||
| log.Fatal().Msg("either local authentication or OIDC must be enabled") | ||
| } |
Member
There was a problem hiding this comment.
Can you move this check to the end of config.Get, so it's included in the futureLogs that is used in this method?
| // | ||
| // required: true | ||
| // example: true | ||
| LocalAuth bool `json:"localauth"` |
Member
There was a problem hiding this comment.
Suggested change
| LocalAuth bool `json:"localauth"` | |
| LocalAuth bool `json:"localAuth"` |
Case this with camel case:
$ rg localauth
docs/spec.json
2943: "localauth",
2947: "localauth": {
model/gotifyinfo.go
21: LocalAuth bool `json:"localauth"`
ui/src/user/Login.tsx
20: const localAuthEnabled = config.get('localauth');
ui/src/common/ElevationForm.tsx
18: const localAuthEnabled = config.get('localauth');
ui/src/config.ts
8: localauth: boolean;
22: localauth: true,
ui/serve.go
21: LocalAuth bool `json:"localauth"`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR attempts to implement #1007
Adds configurable local authentication through GOTIFY_LOCALAUTH_ENABLED, defaults to true to preserve existing behavior.
When local authentication is disabled:
The server exits with a fatal error when both local authentication and OIDC are disabled, preventing startup without an available login method.