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

Trying to use OAuth1Session with Flickr - requests_oauthlib.oauth1_session.VerifierMissing: No client verifier has been set. #502

Closed
smontanaro opened this issue Aug 13, 2022 · 1 comment

Comments

@smontanaro
Copy link

I'm trying to adapt the OAuth1 Workflow documentation to authenticate with the Flickr API. Flickr has a workflow diagram on their site. I wrote the attached script, which is mostly copy/paste of the code from the referenced workflow. I think it follows the Flickr workflow diagram. It seems to work except doesn't return a client verifier. (In particular, I was able to interactively authorize access with the constructed authorization_url.) Here's the output of the successful bits (with suitable elisions):

OAuth1Session: <requests_oauthlib.oauth1_session.OAuth1Session object at 0x7f49065d4b20>
fetch response {'oauth_callback_confirmed': 'true', 'oauth_token': 'blah-blah', 'oauth_token_secret': 'sssh-its-a-secret'}
Please go here and authorize, https://www.flickr.com/services/oauth/authorize?oauth_token=blah-blah
Paste the full redirect URL here: https://www.flickr.com/services/oauth/authorize?oauth_token=blah-blah
oauth response: {'oauth_token': 'blah-blah'}

I get this traceback:

Traceback (most recent call last):
  File "/home/skip/tmp/flickr_oauth.py", line 38, in <module>
    oauth_tokens = oauth.fetch_access_token(access_token_url)
  File "/home/skip/miniconda3/envs/python39/lib/python3.9/site-packages/requests_oauthlib/oauth1_session.py", line 322, in fetch_access_token
    raise VerifierMissing("No client verifier has been set.")
requests_oauthlib.oauth1_session.VerifierMissing: No client verifier has been set.

The Flickr API workflow indicates that it "[r]edirects user back to Application, passing oauth_verifier." Indeed, the returned oauth_response dict lacks an oauth_verifier key:

{'oauth_token': 'blah-blah'}

I know this is really a help request, not a bug report, but I couldn't see anywhere to ask usage questions for this package. Reference to the correct place is welcome, as would information about what I've done wrong.

flickr_oauth.py

@smontanaro
Copy link
Author

Figured out my stupidity. I wasn't pasting the redirect URL, but the auth url. 🦤

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

1 participant