Commit Graph

29 Commits

Author SHA1 Message Date
Trong Huu Nguyen
d6b57a6b7d refactor(handler/sso/proxy): correct variable name 2024-09-11 09:27:13 +02:00
Trong Huu Nguyen
9e78ba78be fix(handler/sso/proxy): avoid duplicate headers when proxying to server 2024-09-03 12:08:38 +02:00
Trong Huu Nguyen
e71e4a2fda feat(handler/reverseproxy): add toggle for access logs 2023-12-20 08:25:35 +01:00
Trong Huu Nguyen
a10da5d0d7 feat(handler/login): add support for prompt param in login 2023-12-19 08:46:01 +01:00
Trong Huu Nguyen
337723150b fix(reverseproxy/autologin): skip cleaning redirect target 2023-09-25 14:13:15 +02:00
Trong Huu Nguyen
34d90d2c78 fix(autologin): do not return ambiguous 3xx redirect
If autologin is enabled, check for headers that indicate that the request is a navigation request
and respond appropriately.

A navigation request is assumed to match all of the following:

- uses the GET HTTP method
- either:
  - a) sends the fetch metadata headers, specifically
    `Sec-Fetch-Mode=navigate` and `Sec-Fetch-Dest=document`, or (if
    unsupported by the browser)
  - b) sends the `Accept` header with a value that contains
    `text/html` (which most browsers do by default for navigation
    requests, the exception being IE8 AFAIK)

Non-navigation requests (e.g. fetch / xhr / ajax requests) will receive a
401 Unauthorized, with the Location header set to the login endpoint.
The redirect parameter is also set to point back to the URL found in the
Referer header (though with the scheme and host removed to only allow
redirects relative to the origin host.)

With this fix, autologin will also intercept requests other than GET.
This is to improve the security posture of upstreams that assume that autologin
enforces authentication for all methods.

Fixes #156.
2023-09-22 14:51:35 +02:00
Trong Huu Nguyen
6151aa3279 feat(openid, handler): support runtime override of redirect after single-logout
Fixes #100.
2023-05-04 14:45:13 +02:00
Trong Huu Nguyen
3a239a95c3 feat(reverseproxy): validate acr and redirect if applicable 2023-04-29 11:54:53 +02:00
Trong Huu Nguyen
7c98fe161e refactor(handler/reverseproxy): retrieve both session and token 2023-04-29 11:17:00 +02:00
Trong Huu Nguyen
efcc276ed5 fix(handler/sso/proxy): redirect logout callbacks to logout 2023-04-29 09:00:28 +02:00
Trong Huu Nguyen
87ffee4a34 fix(handler/sso/proxy): proxy frontchannel logouts 2023-04-29 08:55:14 +02:00
Trong Huu Nguyen
ab2a8b6fec fix(handler/sso/proxy): redirect callback requests to login 2023-04-29 08:52:41 +02:00
Trong Huu Nguyen
568f9f7683 feat(handler): use 302 instead of 303 for redirects 2023-04-29 08:42:29 +02:00
Trong Huu Nguyen
bc651d9082 fix: use 303 instead of 307 for redirects 2023-04-28 01:30:17 +02:00
Trong Huu Nguyen
ad7160e04d fix(handler/sso/proxy): local logout should be reverse proxied 2023-04-21 16:43:33 +02:00
Trong Huu Nguyen
5ad603395c fix(handler/sso/proxy): override request path for reverseproxy to sso-server 2023-04-13 14:19:48 +02:00
Trong Huu Nguyen
9cb648917b fix(handler/sso/proxy): only set default query parameters for login handler 2023-04-13 09:20:34 +02:00
Trong Huu Nguyen
c72093dda9 fix(handler/sso/proxy): use correct query for login url 2023-03-21 09:11:31 +01:00
Trong Huu Nguyen
442e056b26 refactor(handler): inline error handler, remove unnecessary getters 2023-02-24 19:24:02 +01:00
Trong Huu Nguyen
f346e9e91d refactor(router): use a more apt name for wildcard handler 2023-02-24 18:33:41 +01:00
Trong Huu Nguyen
492e0b5625 feat(sso/proxy): implement upstream reverseproxy with prerequisites 2023-02-21 14:50:51 +01:00
Trong Huu Nguyen
fb28da7241 refactor: consolidate handlers 2023-02-16 10:55:50 +01:00
Trong Huu Nguyen
3274cc5c65 refactor: move redirect package into url, clean up naming 2023-02-16 09:24:39 +01:00
Trong Huu Nguyen
66dec32de0 feat(sso/proxy): implement handlers for session routes 2023-02-10 14:58:19 +01:00
Trong Huu Nguyen
42dcba8367 refactor: replace relative canonical redirect with handler
This also ensure that we clean any urls that may stem from user input (e.g.
url parameter or login cookie) before performing redirects.
2023-02-10 14:58:14 +01:00
Trong Huu Nguyen
1fdbe75c9e feat(sso/proxy): implement login handler 2023-02-10 14:58:11 +01:00
Trong Huu Nguyen
c3c0c01926 feat(sso): partially implement handlers 2023-02-10 14:58:09 +01:00
Trong Huu Nguyen
a4e4fc752e refactor(handler): remove provider name getter from handler 2023-02-10 14:57:57 +01:00
Trong Huu Nguyen
3d08d0b4b0 feat: initial skeleton setup for SSO mode 2023-02-10 14:57:56 +01:00