[PR #1105] [MERGED] feat: support proxy forward headers authentication #991

Closed
opened 2026-02-25 23:36:08 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/1105
Author: @pudymody
Created: 5/24/2025
Status: Merged
Merged: 7/12/2025
Merged by: @fmartingr

Base: masterHead: sso


📝 Commits (10+)

  • 9229569 feat: Add SSO forward header
  • 2d0ca4c fix: Use domain layer
  • 2ac9714 test: Some test
  • 9a63a71 chore: Print new values when debugging
  • 0716125 chore: Rename enabled envvar
  • b0ce77b fix: Wrongly parsing remote ip
  • 1c1f7d8 fix: Always validate token. NPE on validateSession
  • 32a5244 fix: Dont overwrite token when sso
  • e66705c fix: Best effort to get ip. Parse as ip:port and then as ip
  • d66a0a0 fix: Forgot to update handler version

📊 Changes

12 files changed (+378 additions, -37 deletions)

View changed files

📝 docs/Configuration.md (+18 -15)
📝 internal/config/config.go (+7 -0)
📝 internal/domains/accounts.go (+18 -0)
📝 internal/domains/accounts_test.go (+24 -0)
📝 internal/http/middleware/auth.go (+4 -0)
internal/http/middleware/auth_sso_proxy.go (+104 -0)
internal/http/middleware/auth_sso_proxy_test.go (+101 -0)
📝 internal/http/server.go (+4 -0)
📝 internal/model/domains.go (+1 -0)
📝 internal/view/index.html (+6 -5)
📝 internal/webserver/handler.go (+77 -17)
📝 internal/webserver/server.go (+14 -0)

📄 Description

Hi, i started using Authelia for my SSO and Shiori is one of the apps i use that currently doesnt support neither proxy forwarding headers or OIDC.

This is my attempt at the first as its easier to implement.
There is https://github.com/go-shiori/shiori/pull/860 but it seems dead and outdated.

The default settings are tailored to my use case and should be enough for almost everyone, but open to different ones as this is a new world to me.

I've been testing it locally for now and everything seems to be working


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-shiori/shiori/pull/1105 **Author:** [@pudymody](https://github.com/pudymody) **Created:** 5/24/2025 **Status:** ✅ Merged **Merged:** 7/12/2025 **Merged by:** [@fmartingr](https://github.com/fmartingr) **Base:** `master` ← **Head:** `sso` --- ### 📝 Commits (10+) - [`9229569`](https://github.com/go-shiori/shiori/commit/92295698caed3a860e9894a2753f0c009ab48105) feat: Add SSO forward header - [`2d0ca4c`](https://github.com/go-shiori/shiori/commit/2d0ca4cddc1de3b16e0fd2b068c69261c173332a) fix: Use domain layer - [`2ac9714`](https://github.com/go-shiori/shiori/commit/2ac9714e2468926dff5bf7fc58f8100101377a6d) test: Some test - [`9a63a71`](https://github.com/go-shiori/shiori/commit/9a63a715de0fa32ad00e5adf40f09ebfe9f0859d) chore: Print new values when debugging - [`0716125`](https://github.com/go-shiori/shiori/commit/0716125084d9ef8a51a849c6f4a1c5c024ae9f98) chore: Rename enabled envvar - [`b0ce77b`](https://github.com/go-shiori/shiori/commit/b0ce77b388c3547d27eebdee07899fa6d0559675) fix: Wrongly parsing remote ip - [`1c1f7d8`](https://github.com/go-shiori/shiori/commit/1c1f7d8cb452ae02c086c28d98e8c7d450d069c0) fix: Always validate token. NPE on validateSession - [`32a5244`](https://github.com/go-shiori/shiori/commit/32a52440d512c19b35da7d58878c51681e4226fe) fix: Dont overwrite token when sso - [`e66705c`](https://github.com/go-shiori/shiori/commit/e66705c512e1cba0e86d9d478a98384b6c0149d0) fix: Best effort to get ip. Parse as ip:port and then as ip - [`d66a0a0`](https://github.com/go-shiori/shiori/commit/d66a0a0067c401028481984b35390eff7ae3b1cc) fix: Forgot to update handler version ### 📊 Changes **12 files changed** (+378 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `docs/Configuration.md` (+18 -15) 📝 `internal/config/config.go` (+7 -0) 📝 `internal/domains/accounts.go` (+18 -0) 📝 `internal/domains/accounts_test.go` (+24 -0) 📝 `internal/http/middleware/auth.go` (+4 -0) ➕ `internal/http/middleware/auth_sso_proxy.go` (+104 -0) ➕ `internal/http/middleware/auth_sso_proxy_test.go` (+101 -0) 📝 `internal/http/server.go` (+4 -0) 📝 `internal/model/domains.go` (+1 -0) 📝 `internal/view/index.html` (+6 -5) 📝 `internal/webserver/handler.go` (+77 -17) 📝 `internal/webserver/server.go` (+14 -0) </details> ### 📄 Description Hi, i started using Authelia for my SSO and Shiori is one of the apps i use that currently doesnt support neither proxy forwarding headers or OIDC. This is my attempt at the first as its easier to implement. There is https://github.com/go-shiori/shiori/pull/860 but it seems dead and outdated. The default settings are tailored to my use case and should be enough for almost everyone, but open to different ones as this is a new world to me. I've been testing it locally for now and everything seems to be working --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 23:36:08 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#991
No description provided.