@@ -96,10 +96,17 @@ func getSMUserAuthCtx(pinnipedURL, uName, password string, config *proxy.TLSConf
9696 return nil , fmt .Errorf ("login failed with code %q: %s" , requiredErrorCode , optionalErrorDescription )
9797 }
9898
99+ customClient := & http.Client {
100+ Transport : & http.Transport {
101+ TLSClientConfig : tlsConfig ,
102+ Proxy : http .ProxyFromEnvironment ,
103+ },
104+ }
99105 // Exchange the authorization code for access, ID, and refresh tokens and perform required
100106 // validations on the returned ID token.
101- tokenCtx , tokenCtxCancelFunc := context .WithTimeout (context .Background (), contextTimeout )
107+ ctxWithValue := context .WithValue (context .Background (), oauth2 . HTTPClient , customClient )
102108
109+ tokenCtx , tokenCtxCancelFunc := context .WithTimeout (ctxWithValue , contextTimeout )
103110 defer tokenCtxCancelFunc ()
104111
105112 token , err := session .sharedOauthConfig .Exchange (tokenCtx , authCode , session .pkceCodePair .Verifier ())
@@ -204,6 +211,7 @@ func (s *smSession) initiateAuthorizeRequestUnamePwd() (*url.URL, error) {
204211 httpClient := & http.Client {
205212 Transport : & http.Transport {
206213 TLSClientConfig : s .tlsConfig ,
214+ Proxy : http .ProxyFromEnvironment ,
207215 },
208216 CheckRedirect : func (r * http.Request , via []* http.Request ) error {
209217 redirected = true
0 commit comments