-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GAE compatibility (urlfetch) #27
Comments
The pattern for this kind of thing thus far has been callback functions that the user can set to provide customized functionality. I would recommend having an This also has the added benefit of not strongly binding @markbates thoughts? |
Sounds like a valid solution if it is in line with Mark's thoughts. |
I don't use GAE, so I'm not sure of the exact nature of the problem, so I'll leave this to Tyler's discretion, as he seems to have a handle on this. |
Sounds good. The approach I posted above should work just fine. @RubenN do you want to go ahead and implement this, then submit a PR? |
Ok |
It turned out to be even simpler and doesn't require code changes.
http.DefaultClient = &http.Client{
Transport: &urlfetch.Transport{Context: c},
}
http.DefaultTransport = &urlfetch.Transport{Context: c}
|
For the record, this does not work anymore with newer versions of oauth2. It looks like it should be unnecessary now, but I can't get it to work at all with oauth2 released after this commit: Works if you revert back to before that commit and use @RubenN 's sollution |
As before, I don't use GAE, so I can't produce. However, @oyvindsk if you can reproduce and know a fix please submit a PR so we can close this. Thanks. |
I'd like to use this on app engine.
What would the best way be to get the proper (urlfetch) compatible Transport in?
(FetchUser uses the default http.Get)
The result i got was:
Post https://accounts.google.com/o/oauth2/token: http.DefaultTransport and http.DefaultClient are not available in App Engine. See https://cloud.google.com/appengine/docs/go/urlfetch/
The text was updated successfully, but these errors were encountered: