Skip to content

Commit

Permalink
Add AccessToken as fallback to Authorization header
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps committed Oct 27, 2020
1 parent 8abc4e6 commit d877dce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions oauthproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,8 @@ func (p *OAuthProxy) addHeadersForProxying(rw http.ResponseWriter, req *http.Req
if p.PassAuthorization {
if session.IDToken != "" {
req.Header["Authorization"] = []string{fmt.Sprintf("Bearer %s", session.IDToken)}
} else if session.AccessToken != "" {
req.Header["Authorization"] = []string{fmt.Sprintf("Bearer %s", session.AccessToken)}
} else {
req.Header.Del("Authorization")
}
Expand Down

0 comments on commit d877dce

Please sign in to comment.