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

Retrieving access token fails #6

Open
mc51 opened this issue May 30, 2019 · 2 comments
Open

Retrieving access token fails #6

mc51 opened this issue May 30, 2019 · 2 comments
Assignees

Comments

@mc51
Copy link

mc51 commented May 30, 2019

First off, thanks for this nice library.

It seems, that retrieving the access token fails. It already fails when trying to get the FB_ID and FB_TOKEN from the FB Username and Password:

---------------------------------------------------------------------------
InvalidSchema                             Traceback (most recent call last)
/opt/Dropbox/dev/envs/tinderbot/files/tinder_api/utils.py in get_fb_access_token(email, password)
     43         try:
---> 44             s.submit_form(f, submit=f.submit_fields['__CONFIRM__'])
     45             access_token = re.search(

~/Dropbox/dev/envs/tinderbot/lib/python3.7/site-packages/robobrowser/browser.py in submit_form(self, form, submit, **kwargs)
    342         send_args.update(serialized)
--> 343         response = self.session.request(method, url, **send_args)
    344 

~/Dropbox/dev/envs/tinderbot/lib/python3.7/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
    532         send_kwargs.update(settings)
--> 533         resp = self.send(prep, **send_kwargs)
    534 

~/Dropbox/dev/envs/tinderbot/lib/python3.7/site-packages/requests/sessions.py in send(self, request, **kwargs)
    667         # Resolve redirects if allowed.
--> 668         history = [resp for resp in gen] if allow_redirects else []
    669 

~/Dropbox/dev/envs/tinderbot/lib/python3.7/site-packages/requests/sessions.py in <listcomp>(.0)
    667         # Resolve redirects if allowed.
--> 668         history = [resp for resp in gen] if allow_redirects else []
    669 

~/Dropbox/dev/envs/tinderbot/lib/python3.7/site-packages/requests/sessions.py in resolve_redirects(self, resp, req, stream, timeout, verify, cert, proxies, yield_requests, **adapter_kwargs)
    246                     allow_redirects=False,
--> 247                     **adapter_kwargs
    248                 )

~/Dropbox/dev/envs/tinderbot/lib/python3.7/site-packages/requests/sessions.py in send(self, request, **kwargs)
    639         # Get the appropriate adapter to use
--> 640         adapter = self.get_adapter(url=request.url)
    641 

~/Dropbox/dev/envs/tinderbot/lib/python3.7/site-packages/requests/sessions.py in get_adapter(self, url)
    730         # Nothing matches :-/
--> 731         raise InvalidSchema("No connection adapters were found for '%s'" % url)
    732 

InvalidSchema: No connection adapters were found for 'fb464891386855067://authorize/#granted_scopes=user_birthday%2Cuser_likes%2Cuser_photos%2Cuser_friends%2Cemail%2Cpublic_profile&denied_scopes=&signed_request=zAHlasryyIqXEE8S3TYALnU2gMTPq2TQjVel_XOtteA.eyJ1c2VyX2lkIjoiNjYxNTEzMjMwOTQwNjY5IiwiY29kZSI6IkFRQ1pXNnoyTERHcFhWVXo4eU1BTHo1QjJTWEtWRk9HLUk0TEY5d0RnYjNpNTA1ZUJtWFVnVmtDUV9kYWl0a2ZTcUxxZDVkS3FKWWdMeWY0N3JtcUdlZVBvV2VVUzVfOHgtV2NWSU5fOXMzdUdZN0wyQ2dUVjRvY3M3dDlrOFJVa1Znemg3WV9SZjB2Rkg0Mk1UMW5GdzF2VmpSM1E2clRQTi1WNHUzYnVuWWhlcnlhRi12ZThtUnprUi1yUm42MXQ3WDBaanJidUxUSE1IZy0zLWlyb1FPOHNfWlZMdjE4NS1aRlNpanV1X25lRlpqWDY4X29qWUdaRHlyUXRfS2EtZ0J4WDlZTXlRcUtHZFRWdTVleVYxSm9ybnQ3Q2x2Q2JMd0ktXzZvLUFNLV9LR2NjS2otOVoxNVFCdnZjcHhEbXVvZkRCNjloSkkxQmRCbDlyMlhKZU9zNWJVQ1pCaWdKc1NzRFRLNnM0Y1pVUmp0c0laSFRRbnhTcFpxRmhxX3FYWXJFdmJjbkR3MUtmWnB0dE1ueVljdCIsImFsZ29yaXRobSI6IkhNQUMtU0hBMjU2IiwiaXNzdWVkX2F0IjoxNTU5MjEzODIwfQ&access_token=EAAGm0PX4ZCpsBAGNvoiWQ1y7GEZBvDquAZCDLJ5FJDQYBWPP4VR64uBwbR5MkZCErOoKx7R54BVG0ZCrcVLkow5Ei2wDMgPwfhpU1C4rcKNpYklB3T5BBZCqHQYGOJTKvWPCMWzgOz4IOlwzZC5qBAucqGouazXUA80se7hW4LU9oy9FS9kPfZAIsnRnola1mPDTKkPZCQbwffRy92s63hwYDiSG0ucjj3jlINlMNJ9iZAdZBrZCa52NQvlT&data_access_expiration_time=1566989820&expires_in=0&state=%7B%22challenge%22%3A%22IUUkEUqIGud332lfu%252BMJhxL4Wlc%253D%22%2C%220_auth_logger_id%22%3A%2230F06532-A1B9-4B10-BB28-B29956C71AB1%22%2C%22com.facebook.sdk_client_state%22%3Atrue%2C%223_method%22%3A%22sfvc_auth%22%7D'

During handling of the above exception, another exception occurred:

AuthenticationError                       Traceback (most recent call last)
<ipython-input-10-0e0ccf83135e> in <module>
----> 1 FBUtils.get_facebook_credentials('x.x@x.ru', 'xxxx')

/opt/Dropbox/dev/envs/tinderbot/files/tinder_api/utils.py in get_facebook_credentials(username, password)
     21         """
     22         log.debug("Trying to get FB_TOKEN from Username: {} and PW: {}".format(username, password))
---> 23         fb_access_token = FBUtils.get_fb_access_token(username, password)
     24         if fb_access_token == None:
     25             raise AuthenticationError('No FB Access Token')

/opt/Dropbox/dev/envs/tinderbot/files/tinder_api/utils.py in get_fb_access_token(email, password)
     47         except Exception as e:
     48             raise AuthenticationError(
---> 49                 "Access token could not be retrieved. Check your username and password:" + str(e))
     50         log.debug("Success getting access token: {}".format(access_token))
     51         return access_token

AuthenticationError: Access token could not be retrieved. Check your username and password:No connection adapters were found for 'fb464891386855067://authorize/#granted_scopes=user_birthday%2Cuser_likes%2Cuser_photos%2Cuser_friends%2Cemail%2Cpublic_profile&denied_scopes=&signed_request=zAHlasryyIqXEE8S3TYALnU2gMTPq2TQjVel_XOtteA.eyJ1c2VyX2lkIjoiNjYxNTEzMjMwOTQwNjY5IiwiY29kZSI6IkFRQ1pXNnoyTERHcFhWVXo4eU1BTHo1QjJTWEtWRk9HLUk0TEY5d0RnYjNpNTA1ZUJtWFVnVmtDUV9kYWl0a2ZTcUxxZDVkS3FKWWdMeWY0N3JtcUdlZVBvV2VVUzVfOHgtV2NWSU5fOXMzdUdZN0wyQ2dUVjRvY3M3dDlrOFJVa1Znemg3WV9SZjB2Rkg0Mk1UMW5GdzF2VmpSM1E2clRQTi1WNHUzYnVuWWhlcnlhRi12ZThtUnprUi1yUm42MXQ3WDBaanJidUxUSE1IZy0zLWlyb1FPOHNfWlZMdjE4NS1aRlNpanV1X25lRlpqWDY4X29qWUdaRHlyUXRfS2EtZ0J4WDlZTXlRcUtHZFRWdTVleVYxSm9ybnQ3Q2x2Q2JMd0ktXzZvLUFNLV9LR2NjS2otOVoxNVFCdnZjcHhEbXVvZkRCNjloSkkxQmRCbDlyMlhKZU9zNWJVQ1pCaWdKc1NzRFRLNnM0Y1pVUmp0c0laSFRRbnhTcFpxRmhxX3FYWXJFdmJjbkR3MUtmWnB0dE1ueVljdCIsImFsZ29yaXRobSI6IkhNQUMtU0hBMjU2IiwiaXNzdWVkX2F0IjoxNTU5MjEzODIwfQ&access_token=EAAGm0PX4ZCpsBAGNvoiWQ1y7GEZBvDquAZCDLJ5FJDQYBWPP4VR64uBwbR5MkZCErOoKx7R54BVG0ZCrcVLkow5Ei2wDMgPwfhpU1C4rcKNpYklB3T5BBZCqHQYGOJTKvWPCMWzgOz4IOlwzZC5qBAucqGouazXUA80se7hW4LU9oy9FS9kPfZAIsnRnola1mPDTKkPZCQbwffRy92s63hwYDiSG0ucjj3jlINlMNJ9iZAdZBrZCa52NQvlT&data_access_expiration_time=1566989820&expires_in=0&state=%7B%22challenge%22%3A%22IUUkEUqIGud332lfu%252BMJhxL4Wlc%253D%22%2C%220_auth_logger_id%22%3A%2230F06532-A1B9-4B10-BB28-B29956C71AB1%22%2C%22com.facebook.sdk_client_state%22%3Atrue%2C%223_method%22%3A%22sfvc_auth%22%7D'

This is the same problem as described here: fbessez#75

/e: My first issue was a honest mistake on my side. I was trying to use an SMS-Token as an FB-Token, which I though was the same.

@mc51
Copy link
Author

mc51 commented Jun 4, 2019

There is a suggested work around by @FelixLabelle here: fbessez#75

@VikashKothary
Copy link
Member

VikashKothary commented Jul 21, 2019

Hi @mc51, thanks for the update.

Sorry for late reply but I'm glad you've found a temporary solution. I'll add the patch to the library then maybe look into something more robust. Thanks for raising the issue.

@VikashKothary VikashKothary self-assigned this Jul 21, 2019
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

2 participants