-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Enable logout redirection for reverse proxy setups #36052
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
base: main
Are you sure you want to change the base?
Conversation
d81b162 to
eb41ffc
Compare
When authentication is handled externally by a reverse proxy or SSO provider, users can be redirected to an external logout URL or relative path defined on the reverse proxy. The reverse proxy or SSO provider must redirect back to Gitea for terminating the local session.
eb41ffc to
5e1923c
Compare
| "MermaidMaxSourceCharacters": func() int { | ||
| return setting.MermaidMaxSourceCharacters | ||
| }, | ||
| "ReverseProxyLogoutRedirect": func() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a global variable rather than a global function
| ;; The external logout endpoint (reverse proxy / IdP) must then redirect | ||
| ;; the user back to /user/logout so Gitea can terminate its local session | ||
| ;; after the global SSO logout completes. | ||
| ;REVERSE_PROXY_LOGOUT_REDIRECT = /mellon/logout?ReturnTo=/user/logout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it makes sense to hardcode one specific provider here in the default value.
If anything, write the path in the comment above as an example for Mellon (I guess?) and leave this value empty.
| } | ||
| HandleSignOut(ctx) | ||
| if ctx.Req.Method == http.MethodGet { | ||
| ctx.Redirect(setting.AppSubURL + "/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the purpose of this extra GET.
Why can it suddenly be a GET?
And why can't it return JSON content?
When authentication is handled externally by a reverse proxy or SSO provider, users can be redirected to an external logout URL or relative path defined on the reverse proxy.
The reverse proxy or SSO provider must redirect back to Gitea for terminating the local session.