Open shanhui1 opened 3 years ago
I was looking for a solution to make self signed certificates work for local development. But I believe this will solve your problem too.
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
sslcli := &http.Client{Transport: tr}
ctx := context.TODO()
ctx = context.WithValue(ctx, oauth2.HTTPClient, sslcli)
src := oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: "...put your token without the Bearer prefix here..."},
)
For our use case, we need to pass in our custom HttpClient and make request with a different OAuth2 Bearer Token. We can't use the oauth2 lib as suggested. Anyway to get access to the req.headers before sending mutation queries?
I have a custom HttpClient such as this: