Skip to content

Commit 7842a13

Browse files
committed
pass context to all requests
1 parent 8472879 commit 7842a13

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

oidc.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"time"
1212

1313
"golang.org/x/net/context"
14+
"golang.org/x/net/context/ctxhttp"
1415
"golang.org/x/oauth2"
1516
jose "gopkg.in/square/go-jose.v2"
1617
)
@@ -84,7 +85,7 @@ type providerJSON struct {
8485
// or "https://login.salesforce.com".
8586
func NewProvider(ctx context.Context, issuer string) (*Provider, error) {
8687
wellKnown := strings.TrimSuffix(issuer, "/") + "/.well-known/openid-configuration"
87-
resp, err := clientFromContext(ctx).Get(wellKnown)
88+
resp, err := ctxhttp.Get(ctx, clientFromContext(ctx), wellKnown)
8889
if err != nil {
8990
return nil, err
9091
}
@@ -173,7 +174,7 @@ func (p *Provider) UserInfo(ctx context.Context, tokenSource oauth2.TokenSource)
173174
}
174175
token.SetAuthHeader(req)
175176

176-
resp, err := clientFromContext(ctx).Do(req)
177+
resp, err := ctxhttp.Do(ctx, clientFromContext(ctx), req)
177178
if err != nil {
178179
return nil, err
179180
}

0 commit comments

Comments
 (0)