News for hackers. Stuff that matters.
Re:Keycloak SSO with Docker Compose and Nginx by mmcnl on Sunday February 11, 2024 @03:39PM (#39338455)
How do I integrate this with a reverse proxy like Caddy and their forward_auth directive? I want to secure my apps on the proxy layer, not the app layer.
Re:Keycloak SSO with Docker Compose and Nginx by mooreds on Sunday February 11, 2024 @04:09PM (#39338725)
You'd have FusionAuth issue the tokens through an authentication event (typically the authorization code grant for interactive sessions). Lots of flows with sequence diagrams outlined here [0].

Then store the tokens on the client. For browsers dealing with first party apps (everything under the same domain) we recommend cookie storage of these tokens [1].

Then have Caddy examine the tokens provided by the browser. Here's an example Caddy config I put together for a workshop [2].

Finally, depending on your security posture, you might want to verify tokens both in app and at the proxy.

0: https://fusionauth.io/articles/login-authentication-workflow...

1: https://fusionauth.io/articles/oauth/oauth-token-storage

2: https://github.com/FusionAuth/fusionauth-example-php-api-wor...

Re:Keycloak SSO with Docker Compose and Nginx by james_d_elliott on Monday February 12, 2024 @06:18AM (#39343669)
Hey one of the Authelia developers here. Authelia works out of the box with Caddy's forward auth directive. In fact I helped Caddy develop and test the feature to ensure it had feature parity with an existing implementation/spec.

You have very granular options to customize the experience allowing multiple sites to have the same or different rules, which can alter the authentication requirements based on remote ip, users, groups, paths, domains, etc.