Skip to content

Commit

Permalink
sso-proxy: update req.host for internal connections to be the host ss…
Browse files Browse the repository at this point in the history
…o-auth uses with its HOST parameter
  • Loading branch information
danbf committed Nov 29, 2018
1 parent aca3229 commit 203aece
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/proxy/providers/sso.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (p *SSOProvider) Redeem(redirectURL, code string) (*SessionState, error) {
if err != nil {
return nil, err
}
req.Host = p.ProviderData.ProviderURLInternal.Host
req.Host = p.ProviderData.ProviderURL.Host
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
resp, err := httpClient.Do(req)
if err != nil {
Expand Down Expand Up @@ -205,7 +205,7 @@ func (p *SSOProvider) UserGroups(email string, groups []string) ([]string, error
if err != nil {
return nil, err
}
req.Host = p.ProviderData.ProviderURLInternal.Host
req.Host = p.ProviderData.ProviderURL.Host
req.Header.Set("X-Client-Secret", p.ClientSecret)
resp, err := httpClient.Do(req)
if err != nil {
Expand Down Expand Up @@ -296,7 +296,7 @@ func (p *SSOProvider) redeemRefreshToken(refreshToken string) (token string, exp
if err != nil {
return
}
req.Host = p.ProviderData.ProviderURLInternal.Host
req.Host = p.ProviderData.ProviderURL.Host
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
resp, err := httpClient.Do(req)
if err != nil {
Expand Down Expand Up @@ -343,7 +343,7 @@ func (p *SSOProvider) ValidateSessionState(s *SessionState, allowedGroups []stri
logger.WithUser(s.Email).Error(err, "error validating session state")
return false
}
req.Host = p.ProviderData.ProviderURLInternal.Host
req.Host = p.ProviderData.ProviderURL.Host
req.Header.Set("X-Client-Secret", p.ClientSecret)
req.Header.Set("X-Access-Token", s.AccessToken)

Expand Down

0 comments on commit 203aece

Please sign in to comment.