Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some security recommendations for when using ForwardAuth #283

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion help/install/forwarded-headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ To make this work, here is what you'll need to do:
- If you want to allow anonymous access in some cases, make sure all
other Grist paths are free of your middleware. Grist will
trigger the middleware (by redirecting to `/auth/login`) as needed.
It's a good idea to strip `GRIST_FORWARD_AUTH_HEADER` from outside requests
on all paths that aren't handld by your middleware.
- Your middleware may allow you to specify where to forward the user to
after logging out. That should be `/signed-out` on the Grist site.

Expand Down Expand Up @@ -49,7 +51,10 @@ web apps served by the same middleware had difficulty coordinating logouts.
That could be resolved by applying the middleware to all Grist paths
and setting `GRIST_IGNORE_SESSION=true` so Grist has no separate notion
of who is signed in. But then sharing some documents with everyone
publically (without signing in) became a problem.
publically (without signing in) became a problem. Note that with `GRIST_IGNORE_SESSION=true`,
Grist will trust `GRIST_FORWARD_AUTH_HEADER` on all requests, so it is imperative that you have
middleware that overrides or strips this header for _all_ outside requests before forwarding them
to Grist.

If on the contrary you want to be sure the user must be logged in before
using Grist in any way, you can set `GRIST_FORCE_LOGIN=true`.