Skip to content
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

Continuously "couldn't authenticate" #28

Closed
nick-bull opened this issue Oct 22, 2015 · 7 comments
Closed

Continuously "couldn't authenticate" #28

nick-bull opened this issue Oct 22, 2015 · 7 comments

Comments

@nick-bull
Copy link

Sanity warning: this is probably an issue with how I'm producing access tokens, rather than the API.

I have attempted to use an access token (created by https://developers.facebook.com/tools/explorer/ and checking every single permission, outputting something that looks like: CAACEdE ... dCqIkf6krQECVGfaOsPqBk), and the ID provided by the GET > /v2.5/me?fields=id,name (looking similar to the format 10153 ... 52316).

However, the example to like 5 users always returns the following:

Traceback (most recent call last):
File "like_5_users.py", line 6, in <module>
session = pynder.Session(FBID, FBTOKEN)
File "build/bdist.linux-x86_64/egg/pynder/session.py", line 14, in __init__
File "build/bdist.linux-x86_64/egg/pynder/api.py", line 26, in auth
pynder.errors.RequestError: Couldn't authenticate

Is there a way to create these tokens automatically, so that newbies like me can't bugger it up? If not, what's the process to create a token and ID that works?

@charliewolf
Copy link
Owner

Sanity check: Can you try generating a token using the method outlined here?

@nick-bull
Copy link
Author

It worked! Weirdly, that was the first method I'd tried, thanks Charlie :)

@nick-bull
Copy link
Author

Is there any way to refresh the token once it's expired?

@charliewolf
Copy link
Owner

Do the same thing again would be one way.
@JoelOtter had a a way to get a longer lasting token here

@nick-bull
Copy link
Author

Perfect, the token works for much longer than 2 hours now - 60 days is how long the aforementioned post suggests. This is long enough to suitably be updated manually. Thanks for all your help!

@afeezaziz
Copy link

Managed to get extended token, used facepy to get FB id but after that still couldn't authenticate.

graph = facepy.GraphAPI(user.access_token)
fb_user_id = graph.get('me')['id']
print fb_user_id


session = pynder.Session(str(fb_user_id), str(user.access_token))
potential_matches = session._api.recs()['results']
print potential_matches

I also tried with and without the str.

@afeezaziz
Copy link

Sorry my fault, you can get extended access token if we have Tinder's secret et cetera. Following DJ Khaled's advice now. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants