Skip to content

feat: #1007 - Option to disable local login when OIDC is enabled - #1020

Merged
jmattheis merged 1 commit into
gotify:masterfrom
DerDummePunkt:github_1007_option_to_disable_local_login_when_oidc_enabled
Aug 13, 2026
Merged

feat: #1007 - Option to disable local login when OIDC is enabled #1020
jmattheis merged 1 commit into
gotify:masterfrom
DerDummePunkt:github_1007_option_to_disable_local_login_when_oidc_enabled

Conversation

@DerDummePunkt

Copy link
Copy Markdown
Contributor

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 does not register POST /auth/local/login.
  • Basic Auth with local Gotify user credentials is rejected by authentication middleware.
  • The check for a local admin account and subsequent creation is skipped.
  • The UI hides the local username/password login form, registration button, and password-based elevation form.
  • The UI receives the public localauth flag through injected window.config.
  • GET /gotifyinfo exposes the same flag as localauth.

The server exits with a fatal error when both local authentication and OIDC are disabled, preventing startup without an available login method.

@DerDummePunkt
DerDummePunkt requested a review from a team as a code owner August 4, 2026 18:33

@jmattheis jmattheis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far. I've some remarks and haven't tested it manually.

Comment thread auth/authentication.go Outdated
Comment thread router/router.go
Comment thread app.go Outdated
Comment thread model/gotifyinfo.go Outdated

@jmattheis jmattheis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made some small fixes.

I'll test this some more and will merge it around end of next week. (For security related stuff I want to take my time and I'm currently a bit busy).

@DerDummePunkt

Copy link
Copy Markdown
Contributor Author

No worries, take your time, there's no rush

@jmattheis
jmattheis force-pushed the github_1007_option_to_disable_local_login_when_oidc_enabled branch from 68b1976 to 529f75e Compare August 13, 2026 18:41
@jmattheis
jmattheis force-pushed the github_1007_option_to_disable_local_login_when_oidc_enabled branch from 529f75e to 795d9d1 Compare August 13, 2026 18:48
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.10345% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.63%. Comparing base (491a17a) to head (795d9d1).

Files with missing lines Patch % Lines
app.go 0.00% 1 Missing ⚠️
router/router.go 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1020      +/-   ##
==========================================
+ Coverage   74.28%   74.63%   +0.34%     
==========================================
  Files          66       66              
  Lines        3512     3532      +20     
==========================================
+ Hits         2609     2636      +27     
+ Misses        698      690       -8     
- Partials      205      206       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jmattheis jmattheis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jmattheis
jmattheis added this pull request to the merge queue Aug 13, 2026
Merged via the queue into gotify:master with commit aceb5ff Aug 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants