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 ability to set a Sign Out URL when using auth proxy #17716

Closed
svh1985 opened this issue Nov 18, 2021 · 11 comments
Closed

Add ability to set a Sign Out URL when using auth proxy #17716

svh1985 opened this issue Nov 18, 2021 · 11 comments
Labels
issue/duplicate The issue has already been reported.

Comments

@svh1985
Copy link

svh1985 commented Nov 18, 2021

Feature Description

It would be great if there would be an option to change the logout URL when using the ENABLE_REVERSE_PROXY_AUTHENTICATION setting. This way we can redirect to the Sign Out page of the authentication handler eg: https://auth.domain.com/logout

Screenshots

No response

@lunny
Copy link
Member

lunny commented Nov 19, 2021

Why don't redirect it in your reverse proxy configuration file?

@svh1985
Copy link
Author

svh1985 commented Nov 20, 2021

Ahh that's also an approach to do it. You're talking about a redirect or a return?
I'm not a NGINX proxy expert but I found some code online. But the Gitea URL for logging out is something I cannot find.

Do you know what the logout URL is that I can use?

location = /user/logout {
  return 301 https://auth.domain.com/logout;
}

@lunny
Copy link
Member

lunny commented Nov 22, 2021

POST /usr/logout

@lunny lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Nov 22, 2021
@zeripath
Copy link
Contributor

Why not simply change the head_navbar.tmpl to be the correct logout url?

@svh1985
Copy link
Author

svh1985 commented Nov 22, 2021

Good point. But currently all changes can be done from the config file, adding another parameter for the logoutURL makes implementation (and documentation) a bit easier for Gitea admins.

@zeripath
Copy link
Contributor

zeripath commented Nov 22, 2021

I understand but I'm not certain we should jump to make this configurable without allowing other authenticators eg. OAuth2 or LDAP to cascade their logouts too. ​

Although as #17740 would likely require a cascading logout this would be a reason to implement it sooner.

@yoyoyonas
Copy link

related / possible duplicate: #14270

@yoyoyonas
Copy link

yoyoyonas commented Dec 15, 2021

Why not simply change the head_navbar.tmpl to be the correct logout url?

Could you advice me how to achieve logging out from Gitea and from the auth provider?
Since Gitea requires a POST request, I can not solve this simply by letting the auth provider redirect to a Gitea logout URL after logging out there.

So I thought, I can change the data-redirect parameter of the logout action to logout from the provider after logging out from Gitea, from data-redirect="{{AppSubUrl}}/" to data-redirect="https://sso.example.com/auth/realms/master/protocol/openid-connect/logout?redirect_uri=https%3A%2F%2Fgit.example.com%2F.

<a class="item link-action" href data-url="{{AppSubUrl}}/user/logout" data-redirect="{{AppSubUrl}}/">
{{svg "octicon-sign-out"}}
{{.i18n.Tr "sign_out"}}<!-- Sign Out -->

But still, Gitea redirects me to {{AppSubUrl}}/" after logging out, not to the external URL.
(I checked the site source; the custom template did work.)

@novirium
Copy link

Currently it looks like the redirect is actually happening on the server side as a response to the /user/logout POST, so it can't be changed by modifying the frontend.

Adding a config option to be able to set the logout redirect URL in auth.go would solve this problem, and also provide the basic functionality for #16869 and #14270 (while not implementing the full OIDC spec, it's all that's needed for seamless logout for a lot of SSO use cases).

@Baitanik
Copy link

any idea when this logout with reverse proxy will get resolved ?
we have ibm webseal as the authenticator and gitea we have ENABLE_REVERSE_PROXY_AUTHENTICATION = true.

but when logout happens from gitea, it does not call logout from webseal..
Please let us know when this will be fixed in gitea

@lunny lunny closed this as completed Mar 29, 2023
@wxiaoguang
Copy link
Contributor

Dup of #14270 ?

@lunny lunny added issue/duplicate The issue has already been reported. and removed issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail labels Mar 29, 2023
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/duplicate The issue has already been reported.
Projects
None yet
Development

No branches or pull requests

7 participants