Skip to content

Conversation

@eliroca
Copy link

@eliroca eliroca commented Nov 28, 2025

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.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 28, 2025
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files docs-update-needed The document needs to be updated synchronously labels Nov 28, 2025
@eliroca eliroca marked this pull request as ready for review November 28, 2025 18:19
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.
"MermaidMaxSourceCharacters": func() int {
return setting.MermaidMaxSourceCharacters
},
"ReverseProxyLogoutRedirect": func() string {
Copy link
Member

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

@lunny lunny added the type/enhancement An improvement of existing functionality label Dec 1, 2025
;; 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
Copy link
Member

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 + "/")
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-update-needed The document needs to be updated synchronously lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants