Skip to content

Commit

Permalink
Add function to return entire OAuth dictionary
Browse files Browse the repository at this point in the history
There are important parameters here like expiry date

Signed-off-by: Brian Donohue <[email protected]>
  • Loading branch information
Donohue committed Jun 24, 2015
1 parent 170339e commit 34ab2ab
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions lib/evernote/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,27 @@ def get_authorize_url(self, request_token):
self._get_endpoint('OAuth.action'),
urllib.quote(request_token['oauth_token']))

def get_access_token(
def get_access_token_dict(
self, oauth_token, oauth_token_secret, oauth_verifier
):
token = oauth.Token(oauth_token, oauth_token_secret)
token.set_verifier(oauth_verifier)
client = self._get_oauth_client(token)

resp, content = client.request(self._get_endpoint('oauth'), 'POST')
access_token = dict(urlparse.parse_qsl(content))
self.token = access_token['oauth_token']
return self.token
access_token_dict = dict(urlparse.parse_qsl(content))
self.token = access_token_dict['oauth_token']
return access_token_dict

def get_access_token(
self, oauth_token, oauth_token_secret, oauth_verifier
):
access_token_dict = self.get_access_token_dict(
oauth_token,
oauth_token_secret,
oauth_verifier
)
return access_token_dict['oauth_token']

def get_user_store(self):
user_store_uri = self._get_endpoint("/edam/user")
Expand Down

0 comments on commit 34ab2ab

Please sign in to comment.