Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
Logout Redirection (#365)
Browse files Browse the repository at this point in the history
- fixing up the logout redirection to keycloak (note, this url has to be in the verified url in the client)
  • Loading branch information
gambol99 authored May 25, 2018
1 parent cc91b89 commit 72a3646
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,10 @@ func (r *oauthProxy) logoutHandler(w http.ResponseWriter, req *http.Request) {

// @check if we should redirect to the provider
if r.config.EnableLogoutRedirect {
sendTo := fmt.Sprintf("%s/protocol/openid-connect/logout?redirect_uri=%s",
strings.TrimSuffix(r.config.DiscoveryURL, "/.well-known/openid-configuration"), redirectURL)

sendTo := fmt.Sprintf("%s/protocol/openid-connect/logout", strings.TrimSuffix(r.config.DiscoveryURL, "/.well-known/openid-configuration"))
if redirectURL != "" {
sendTo = fmt.Sprintf("%s?redirect_uri=%s", sendTo, url.QueryEscape(redirectURL))
}
r.redirectToURL(sendTo, w, req)

return
Expand Down

0 comments on commit 72a3646

Please sign in to comment.