Skip to content

Commit

Permalink
Load the available CA in logout API (minio#3044)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjuarezd authored Sep 13, 2023
1 parent a559421 commit 65b0bab
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions restapi/user_logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package restapi

import (
"context"
"crypto/tls"
"encoding/base64"
"encoding/json"
"net/http"
Expand All @@ -37,7 +38,7 @@ func registerLogoutHandlers(api *operations.ConsoleAPI) {
api.AuthLogoutHandler = authApi.LogoutHandlerFunc(func(params authApi.LogoutParams, session *models.Principal) middleware.Responder {
err := getLogoutResponse(session, params)
if err != nil {
return authApi.NewLogoutDefault(err.Code).WithPayload(err.APIError)
api.Logger("IDP logout failed: %v", err.APIError)
}
// Custom response writer to expire the session cookies
return middleware.ResponderFunc(func(w http.ResponseWriter, p runtime.Producer) {
Expand Down Expand Up @@ -101,7 +102,14 @@ func logoutFromIDPProvider(r *http.Request, state string) error {
params.Add("client_id", providerCfg.ClientID)
params.Add("client_secret", providerCfg.ClientSecret)
params.Add("refresh_token", refreshToken.Value)
_, err := http.PostForm(providerCfg.EndSessionEndpoint, params)
client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
RootCAs: GlobalRootCAs,
},
},
}
_, err := client.PostForm(providerCfg.EndSessionEndpoint, params)
if err != nil {
return err
}
Expand Down

0 comments on commit 65b0bab

Please sign in to comment.