-
Notifications
You must be signed in to change notification settings - Fork 515
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
Some Session methods don't work with http client created by golang.org/x/oauth2 #40
Comments
I ended up with this: app := facebook.New("AppId", "AppSecret")
api := app.Session("token")
api.Version = "v2.2"
api.HttpClient = client // Client coming from golang.org/x/oauth2. The only thing I'm not satisfied with is that this pkg forces me to provide AppId, AppSecret and Token. Which is what Any suggestions? :) |
You can use |
Here's what I'm saying: So, is it possible to use the API directly without setting AppId, AppSecret and AccessToken? Seems like most of the methods fail on checks like Lines 229 to 232 in ff27e4b
Thanks for your feedback:) |
I guess I could use |
Given api := &facebook.Session{
Version: "v2.4",
HttpClient: client,
} I can't use the following methods, as they return errors because of missing Session ID / AccessToken: err := api.Validate()
id, err := api.User() But the following works :-) res, err := api.Get("/me/accounts", getFbParams(url.Values{})) |
OK. I get your point. I think it's reasonable to by-pass some access token checks when |
Yea, that'd do it. Thanks! |
Please try latest code and let me know whether it works for you now. |
That was fast, wow.. And it works now! @huandu Thank you very much for such a fast resolution and for this project in general. Cheers. |
How can I use this pkg with golang.org/x/oauth2 properly?
The question is... how do I create new Session with my own HttpClient and without any AccessToken (as my client's Transport already handles that)?
The text was updated successfully, but these errors were encountered: