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

Use end-session-endpoint in logout redirects if it exists #619

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ 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", strings.TrimSuffix(r.config.DiscoveryURL, "/.well-known/openid-configuration"))
if r.idp.EndSessionEndpoint != nil {
sendTo = r.idp.EndSessionEndpoint.String()
}

// @step: if no redirect uri is set
if redirectURL == "" {
Expand Down