Commit Graph
2342 Commits
Author SHA1 Message Date
Jan Larwig 65037b086c change affiliation 2026-04-17 10:56:42 +02:00
github-actions[bot]andJan Larwig 5961fd99b4 release v7.15.2 (#3413)
* update to release version v7.15.2

* doc: add changelog entry for v7.15.2

Signed-off-by: Jan Larwig <jan@larwig.com>

* fix(deps): override webpackbar to v7 for webpack 5.106.0 compatibility

As outlined in https://github.com/facebook/docusaurus/issues/11923

Signed-off-by: Jan Larwig <jan@larwig.com>

* chore: fix local test files for nginx setup

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
v7.15.2
2026-04-14 13:12:28 +02:00
Jan Larwig bdfde725c6 Merge commit from fork
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-04-13 18:29:01 +02:00
Jan Larwig cc0e0335ea Merge commit from fork
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-04-13 18:24:51 +02:00
Jan Larwig aff369dfa3 Merge commit from fork
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-04-13 18:22:56 +02:00
Jan Larwig 43596a7bab Merge commit from fork
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-04-13 18:20:36 +02:00
Jan LarwigandChristopher Schrewing 0337a95fc6 Merge commit from fork
* fix: clear session cookie at beginning of signinpage handler

Co-authored-by: Christopher Schrewing <christopher.schrewing@weidmueller.com>
Signed-off-by: Michael Bella <michael.bella@weidmueller.com>
Signed-off-by: Jan Larwig <jan@larwig.com>

* test: clear session cookie at beginning of signinpage handler

Signed-off-by: Jan Larwig <jan@larwig.com>

* doc: changelog entry for GHSA-f24x-5g9q-753f

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Michael Bella <michael.bella@weidmueller.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Christopher Schrewing <christopher.schrewing@weidmueller.com>
2026-04-13 18:17:50 +02:00
Francesco Pasqualini 2e1261c4be fix: invalidate session on fatal OAuth2 refresh errors (#3333)
* fix: invalidate session on fatal OAuth2 refresh errors

When a token refresh fails with a fatal OAuth2 error (invalid_grant,
invalid_client), the session is now cleared from the session store
and the cookie is removed, forcing re-authentication.

Previously, fatal refresh errors were logged but the stale session
continued to be served, leaving users logged in indefinitely after
their session was revoked at the provider level.

Transient errors (network timeouts, server errors) continue to
preserve the existing session as before.

Fixes #1945

Signed-off-by: Francesco Pasqualini <frapas@gmail.com>

* fix: apply review nits and add CHANGELOG entry

Signed-off-by: Francesco Pasqualini <frapas@gmail.com>
Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Francesco Pasqualini <frapas@gmail.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-04-12 14:48:55 +02:00
Jan Larwig 26de082a78 chore(deps): update gomod dependencies (#3411)
-       github.com/coreos/go-oidc/v3 v3.17.0
+       github.com/coreos/go-oidc/v3 v3.18.0

-       github.com/go-jose/go-jose/v3 v3.0.4
+       github.com/go-jose/go-jose/v3 v3.0.5

-       github.com/go-viper/mapstructure/v2 v2.4.0
+       github.com/go-viper/mapstructure/v2 v2.5.0

-       golang.org/x/crypto v0.49.0
+       golang.org/x/crypto v0.50.0

-       golang.org/x/net v0.52.0
+       golang.org/x/net v0.53.0

-       google.golang.org/api v0.272.0
+       google.golang.org/api v0.275.0

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
2026-04-12 14:21:47 +02:00
Justus 761bf3b42b build(deps): bump github.com/go-jose/go-jose/v4 to 4.1.4 (#3400)
Signed-off-by: Juqsi <91261422+Juqsi@users.noreply.github.com>
2026-04-08 21:25:17 +02:00
Jan Larwig da9123f740 doc: fix config validation formatting (#3386)
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-03-23 16:05:54 +01:00
Jan Larwig 7bc4b5e5df doc: fix changelog for v7.15.0 2026-03-23 15:54:46 +01:00
github-actions[bot]andJan Larwig 848ec8ba82 release v7.15.1 (#3384)
* update to release version v7.15.1

* doc: release notes for v7.15.1

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
v7.15.1
2026-03-23 15:46:15 +01:00
Jan LarwigandSimon Engmann 46be69c276 fix: propagate errors during route building (#3383)
* Propagate errors during route building

This fixes cases such as invalid paths being silently discarded after
creation by throwing a visible error in such cases.
Due to the way gorilla/mux's fluent API is designed, it is necessary to
manually call `.GetError()` to check for errors while building routes.

Signed-off-by: Simon Engmann <simon.engmann@sovity.de>

* Add test for route building error propagation

Signed-off-by: Simon Engmann <simon.engmann@sovity.de>

* Add route building error propagation to changelog

Signed-off-by: Simon Engmann <simon.engmann@sovity.de>

---------

Signed-off-by: Simon Engmann <simon.engmann@sovity.de>
Co-authored-by: Simon Engmann <simon.engmann@sovity.de>
2026-03-23 11:25:20 +01:00
Yosri BarhoumiandJan Larwig e2682f7595 fix: improve logging when session refresh token is missing (#3327)
* Improve logging for session refresh token status

Signed-off-by: Yosri Barhoumi <med.yosri.brh@gmail.com>

* doc: add changelog entry for #3327

Signed-off-by: Jan Larwig <jan@larwig.com>

* test: fix existing test cases for new behaviour

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Yosri Barhoumi <med.yosri.brh@gmail.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-23 10:54:32 +01:00
Jan Larwig 5ca3012652 doc: update PR template with additional checklist items 2026-03-23 10:36:19 +01:00
artificiosusandJan Larwig 44236f0314 fix: do not log error for backend logout 204 (#3381)
* Don't log error for backend logout 204

Signed-off-by: artificiosus <artificiosus@users.noreply.github.com>

* doc: add changelog entry for #3381

Signed-off-by: Jan Larwig <jan@larwig.com>

* refactor: use http.StatusOK and http.StatusNoContent instead of integers

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: artificiosus <artificiosus@users.noreply.github.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-23 10:27:49 +01:00
H1netandJan Larwig a4d89036ec fix: handle Unix socket RemoteAddr in IP resolution (#3374)
* fix: handle Unix socket RemoteAddr in IP resolution

When oauth2-proxy listens on a Unix socket, Go sets RemoteAddr to "@"
instead of the usual "host:port" format. This caused net.SplitHostPort
to fail on every request, flooding logs with errors:

  Error obtaining real IP for trusted IP list: unable to get ip and
  port from http.RemoteAddr (@)

Fix by handling the "@" RemoteAddr at the source in getRemoteIP,
returning nil without error since Unix sockets have no meaningful
client IP. Also simplify the isTrustedIP guard and add a nil check
in GetClientString to prevent calling String() on nil net.IP.

Fixes #3373

Signed-off-by: h1net <ben@freshdevs.com>

* docs: add changelog entry and Unix socket trusted IPs documentation

Add changelog entry for #3374. Document that trusted IPs cannot match
against RemoteAddr for Unix socket listeners since Go sets it to "@",
and that IP-based trust still works via X-Forwarded-For with reverse-proxy.

Signed-off-by: Ben Newbery <ben.newbery@gmail.com>
Signed-off-by: h1net <ben@freshdevs.com>

* doc: fix changelog entry for #3374

Signed-off-by: Jan Larwig <jan@larwig.com>

* doc: add trusted ip a section to versioned docs as well

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: h1net <ben@freshdevs.com>
Signed-off-by: Ben Newbery <ben.newbery@gmail.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-23 10:22:36 +01:00
renovate[bot] 9f09d54ba4 chore(deps): update actions/upload-artifact action to v7 (#3358)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-23 09:39:22 +01:00
Jan Larwig 0ecc35ea41 chore(deps): update gomod and golangci/golangci-lint to v2.11.4 (#3382)
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-03-23 09:38:12 +01:00
github-actions[bot]andJan Larwig 96c9ec6986 release v7.15.0 (#3378)
* add new docs version 7.15.x

* update to release version v7.15.0

* doc: changelog for v7.15.0 and extended docs for additional claims

* ci: fix trivy failure for release PR

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
v7.15.0
2026-03-19 01:10:21 +08:00
Jan LarwigandTristan 9ae0b325a6 feat: add support for setting a unix binding's socket file mode (#3376)
fix: linter issues and set default unix socket permissions to 0660

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Tristan <tristan@mangadex.org>
2026-03-19 00:08:50 +08:00
JoostandJan Larwig cdbdb1128d feat: add same site option for csrf cookies (#3347)
* the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion

Signed-off-by: Joost <439100+jvnoije@users.noreply.github.com>

* Add cookie-csrf-samesite option

Most of the code is copied form pull request #1947

Signed-off-by: Joost <439100+jvnoije@users.noreply.github.com>

* Update CHANGELOG.md

Signed-off-by: Joost <439100+jvnoije@users.noreply.github.com>

* Removed release information (review comment)

Signed-off-by: Joost <439100+jvnoije@users.noreply.github.com>

* All cookie variables in a struct

Signed-off-by: Joost <439100+jvnoije@users.noreply.github.com>

* doc: add changelog entry for #3347

Signed-off-by: Jan Larwig <jan@larwig.com>

* revert: unnecessary removal of docker compose version

Signed-off-by: Jan Larwig <jan@larwig.com>

* doc: sort csrf flags

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Joost <439100+jvnoije@users.noreply.github.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-18 23:14:36 +08:00
Mayowa FajobiandJan Larwig 51ecc50372 feat: add --config-test flag for validating configuration (#3338)
* feat: add --config-test flag for validating configuration without starting the proxy

Signed-off-by: MayorFaj <mayorfaj@gmail.com>

* doc: fix alpha config and add changelog entry for #3338

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: MayorFaj <mayorfaj@gmail.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-18 23:00:07 +08:00
Ganesh JagadeesanandJan Larwig fe5c6becec doc: add missing redis-ca-path documentation (#3341)
Signed-off-by: Ganesh Jagadeesan <itsjpg@gmail.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-18 22:46:31 +08:00
Br1anandJan Larwig 779cc5f350 fix: filter empty strings from allowed groups (#3365)
* fix: filter empty strings from allowed groups

When parsing allowed groups from configuration (e.g., via environment
variable OAUTH2_PROXY_ALLOWED_GROUPS), viper may include empty
strings in the parsed slice when trailing commas are present
(e.g., "group2," becomes ["group2", ""]).

The setAllowedGroups function now filters out empty strings before
adding them to the AllowedGroups map, ensuring that only valid group
names are checked during authorization.

Fixes #3123

Signed-off-by: Br1an67 <932039080@qq.com>

* refactor: minor change

Signed-off-by: Jan Larwig <jan@larwig.com>

* doc: add changelog entry for 3365

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Br1an67 <932039080@qq.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-18 22:44:11 +08:00
Br1anandJan Larwig ff357daa04 fix: use CSRFExpire instead of Expire for CSRF cookie validation (#3369)
* fix: use CSRFExpire instead of Expire for CSRF cookie validation

Signed-off-by: Br1an67 <932039080@qq.com>

* doc: add changelog entry for #3369

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Br1an67 <932039080@qq.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-18 22:30:07 +08:00
andoksandJan Larwig 7c96234233 feat: add support for specifying allowed OIDC JWT signing algorithms (#2753) (#2851)
* feat: add support for specifying allowed OIDC JWT signing algorithms (#2753)

TODO:
- [X] update docs
- [X] add support in yaml (modern) config
- [X] add more test(s)?

Add (legacy for now) configuration flag "oidc-enabled-signing-alg" (cfg:
oidc_enabled_signing_algs) that allows setting what signing algorithms
are specified by provider in JWT header ("alg" header claim).

In particular useful when skip_oidc_discovery = true, as verifier
defaults to only accept "RS256" in alg field in such circumstances.

Signed-off-by: Jan Larwig <jan@larwig.com>

* doc: update changelog and alpha config

Signed-off-by: Jan Larwig <jan@larwig.com>

* feat: add signing algorithm intersection handling with oidc discovery and additional tests

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-18 22:24:27 +08:00
Alban FonrougeandJan Larwig 30853098c7 feat: possibility to inject id_token in redirect url during sign out (#3278)
* feat: possibility to inject id_token in redirect url during sign out

Signed-off-by: Alban Fonrouge <alban.fonrouge@visma.com>

* doc: changelog for #3278

Signed-off-by: Jan Larwig <jan@larwig.com>

* test: fix assertion for TestIdTokenPlaceholderInSignOut

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Alban Fonrouge <alban.fonrouge@visma.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-18 20:19:10 +08:00
renovate[bot] 8cb06b7ada chore(deps): update docker-compose (#3320)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-17 21:10:44 +08:00
renovate[bot] 7e225eed2c chore(deps): update dependency @easyops-cn/docusaurus-search-local to ^0.55.0 (#3356)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-03-17 21:09:14 +08:00
Jan Larwig 274d7dec46 ci: harden workflows; add trivy scanning; (#3372)
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-03-17 21:07:53 +08:00
e59f7c1549 feat: allow arbitrary claims from the IDToken and IdentityProvider UserInfo endpoint to be added to the session state (#2685)
* feat: support additional claims

Signed-off-by: afsu <suaf2020@163.com>
Signed-off-by: af su <saf@zjuici.com>

* docs: clarify that AdditionalClaims may come from id_token or userinfo endpoint

Signed-off-by: afsu <suaf2020@163.com>
Signed-off-by: af su <saf@zjuici.com>

* feat: include AdditionalClaims in /oauth2/userinfo response (#834)

Signed-off-by: afsu <suaf2020@163.com>
Signed-off-by: af su <saf@zjuici.com>

* refactor: extract coerceClaim logic into util

Signed-off-by: afsu <suaf2020@163.com>
Signed-off-by: af su <saf@zjuici.com>

* doc: add changelog entry for #2685

Signed-off-by: Jan Larwig <jan@larwig.com>

* refactor: added more verbose comments to some struct fields and minor code cleanup

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: afsu <suaf2020@163.com>
Signed-off-by: af su <saf@zjuici.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: af su <saf@zjuici.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-14 12:04:33 +08:00
Nick NikolakakisandJan Larwig c6355ee402 docs: add statusRewrites to Traefik Errors middleware example (#3360)
Add statusRewrites (401 -> 302) to the ForwardAuth with Errors
middleware configuration and a troubleshooting note explaining that
without it, browsers may show a "Found." link instead of
auto-redirecting to the identity provider.

Fixes #3359

Signed-off-by: Nick Nikolakakis <nonicked@protonmail.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-14 11:09:25 +08:00
6d272214e1 docs: fix plural typo in gitlab provider flag (#3363)
* doc: fix plural typo in gitlab provider flag

Signed-off-by: Mridul Yadav <mridul@Mriduls-MacBook-Air.local>

* doc: fix plural typo in gitlab provider flag in versioned docs

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Mridul Yadav <mridul@Mriduls-MacBook-Air.local>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Mridul Yadav <mridul@Mriduls-MacBook-Air.local>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-14 10:58:26 +08:00
Francois BothaandJan Larwig 566b3aac9f ci: distribute windows binary with .exe extension (#3332)
* Ensure Windows binary has .exe extension

Signed-off-by: Jan Larwig <jan@larwig.com>

* doc: add changelog for #3332

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-14 10:36:24 +08:00
Br1an 5f446c3e00 fix(devcontainer): bump Go version to 1.25 in devcontainer base image (#3366)
The devcontainer was using Go 1.23 but go.mod requires Go 1.25.0.
This caused 'go mod tidy' to fail in the devcontainer environment.

Signed-off-by: Jan Larwig <jan@larwig.com>
2026-03-14 10:08:19 +08:00
Vivek S SejpalandJan Larwig 75ff537915 fix: backend logout URL call on sign out (#3172) (#3352)
* Fix backend logout URL call on sign out (#3172)

Signed-off-by: Vivek Sejpal <vsejpal@gmail.com>

* doc: changelog entry for #3352

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Vivek Sejpal <vsejpal@gmail.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
2026-03-14 10:05:57 +08:00
renovate[bot] 88075737a6 chore(deps): update alpine docker tag to v3.23.3 (#3329)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-27 15:00:04 +01:00
github-actions[bot]andJan Larwig b5c8df7988 release v7.14.3 (#3351)
* update to release version v7.14.3

* doc: release note v7.14.3

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
v7.14.3
2026-02-26 15:03:07 +01:00
Jan Larwig 788f3d0e1d ci: ensure we always use the latest patch version of golang (#3350)
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-02-26 14:48:35 +01:00
Jan Larwig 06f1234b69 ci: ensure we always use the latest patch version of golang (#3349)
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-02-26 14:43:52 +01:00
Joel Speed a279fece02 Merge pull request #3183 from Richard87/do-not-override-idle-timeout
fix: dont override parameters set in redis uri
2026-02-19 10:37:57 +00:00
Richard Hagen 7822698ab1 fix: update CHANGELOG to include new fix for URL parameters configuration
Signed-off-by: Richard Hagen <richard.hagen@gmail.com>
2026-02-19 10:20:26 +01:00
Richard Hagen 7747a88404 fix: add tests for configure options and URL overrides when empty
Signed-off-by: Richard Hagen <richard.hagen@gmail.com>
2026-02-19 10:16:47 +01:00
Richard87 178532741f fix: dont override parameters set in redis uri
Signed-off-by: Richard Hagen <richard.hagen@gmail.com>
2026-02-19 10:16:47 +01:00
Jan Larwig e7724f3a74 ci: ensure release branches originate from the local repository and reduce residual risk of command injection (#3337)
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-02-12 21:18:45 +01:00
github-actions[bot]andJan Larwig 3a55dadbe8 release v7.14.2 (#3317)
* update to release version v7.14.2

* doc: changelog entry for v7.14.2

Signed-off-by: Jan Larwig <jan@larwig.com>

* doc: fix nginx example docker-compose

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
v7.14.2
2026-01-18 01:19:17 +01:00
Jan Larwig d5ea33bea7 ci: avoid running qlty coverage report for PRs (#3316)
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-01-18 01:05:54 +01:00
Stefan Markmann dcc7970a5f docs: fix how to use skip-provider-button with proper auth redirect handling (#3315)
* docs(nginx): Clarify auth_request redirect pattern with named location

Update the nginx integration documentation to recommend using a named location
(@oauth2_signin) for the error_page directive instead of the previous
'error_page 401 =403' approach.

The named location pattern ensures the browser receives a proper 302 redirect,
which is required for --skip-provider-button=true to work correctly.

The previous pattern (error_page 401 =403 /oauth2/sign_in) returned a 403
status with a Location header. Browsers do not auto-follow redirects on 403
responses, causing users to see a 'Found.' link instead of being automatically
redirected to the IdP.

Changes:
- Updated main nginx example to use @oauth2_signin named location
- Added 'Understanding the error_page redirect pattern' section
- Added warning about the limitations of 'error_page 401 =403'
- Updated local test environment (contrib/local-environment/nginx.conf)

Refs: #334
Signed-off-by: Stefan Markmann <stefan@markmann.net>

* docs: clarify browser vs API routes for nginx auth_request redirects

Add new "Browser vs API Routes" section explaining:
- Use 302 redirect to /oauth2/sign_in only for browser-facing routes
- Use 401/403 without redirect for API/machine clients

This ensures:
- Browsers get a redirect and smooth login flow
- API clients fail fast with appropriate HTTP status codes
- /oauth2/auth remains a pure boolean oracle (2xx/401)

Signed-off-by: Stefan Markmann <stefan@markmann.net>
Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Stefan Markmann <stefan@markmann.net>
Signed-off-by: Jan Larwig <jan@larwig.com>
2026-01-18 00:55:46 +01:00