I just got my key activated for evernote and I am struggling with the oauth.

When requesting oauths tokens via this method: request_token = client.get_request_token('http://localhost')

I get my 3 arguments:

  • oauth_token
  • oauth_token_secret
  • oauth_callback_confirmed

Then trying to get my access token using this method:

access_token = client.get_access_token(
     oauth_token = request_token['oauth_token'] ,
     oauth_token_secret= request_token['oauth_token_secret'],
     oauth_verifier=oauth_verifier )

I don't understand where I get the oauth_verifier from. I used 2222 as it's what everyone seems to use, but I still get that error:

line 69, in get_access_token
     self.token = access_token_dict['oauth_token'] KeyError: 'oauth_token'`

Trying to get an access token and tried to pass arguments manually.

1

There are 1 best solutions below

0
Djing On

oauth_token is not in the request_token, this means client.get_request_token('http://localhost') did not get correct result. Checking your api_key might help.
By the way, you need client.get_authorize_url(request_token) to get an authorization URL after obtaining request_token. Access this URL from the browser, and the oauth_verifier will appear in the parameters of the callback URL if successfully authorized.