0

Delicious OAuth - Step 4: Invalid signature

Hello everyone,

I am trying to access Delicious using OAuth, I am getting stuck on Step 4 (getting and Access Token). The response says my signature is invalid. I have read both the Delicious step-by-step docs and the YDN OAuth flow docs, but I am still stuck.

Here is the Python code I am using. I pasted it directly from a Django app, so to test-run it you can replace the settings.DELICIOUS_* with your own consumer key and secret. The last print statement outputs "signature_invalid".

CODE
  request_token_params = {
'oauth_nonce': '123456789',
'oauth_timestamp': int(time.time()),
'oauth_consumer_key': settings.DELICIOUS_API_KEY,
'oauth_signature_method': 'PLAINTEXT',
'oauth_signature': settings.DELICIOUS_SHARED_SECRET + '&',
'oauth_version': 1.0,
'oauth_callback': 'oob',
}

consumer = Consumer(settings.DELICIOUS_API_KEY,
settings.DELICIOUS_SHARED_SECRET)

client = Client(consumer)

resp, content = client.request("https://api.login.yahoo.com/oauth/v2/get_request_token", 'POST',
body=urllib.urlencode(request_token_params))

result = urlparse.parse_qs(content)

auth_url = result['xoauth_request_auth_url'][0]

webbrowser.open_new_tab(auth_url + '&' + urllib.urlencode(request_token_params))

oauth_token = result['oauth_token'][0]
oauth_token_secret = result['oauth_token_secret'][0]
oauth_verifier = raw_input('verifier:')

access_token_params = {
'oauth_nonce': '123456789',
'oauth_timestamp': int(time.time()),
'oauth_consumer_key': settings.DELICIOUS_API_KEY,
'oauth_signature_method': 'PLAINTEXT',
'oauth_signature': settings.DELICIOUS_SHARED_SECRET + '&' + oauth_token_secret,
'oauth_version': 1.0,
'oauth_verifier': oauth_verifier,
'oauth_token': oauth_token,
}

resp, content = client.request("https://api.login.yahoo.com/oauth/v2/get_token", 'POST',
body=urllib.urlencode(access_token_params))

print content

by
2 Replies
  • Just so it is simpler to test, here are my KEY and SECRET:

    CODE
    KEY: dj0yJmk9aU5qNVNaMHpWR0dmJmQ9WVdrOVdFeFJabUZxTkhVbWNHbzlNVEEwTXpJeE5qUTJNZy0tJnM9
    Y29uc3VtZXJzZWNyZXQmeD1iZg--
    SECRET: 4b2846fa5bf5a7040e926216f87a20eb595a4de2
    0
  • Hi,

    Can you please send the complete HTTP request and response and
    the Signature Base String that you use for the signature
    calculation? We cannot really try with your Python program
    because we don't have the environment for all programming
    environment.

    Thanks,
    Yu Wang
    Yahoo! Membership Team
    0

Recent Posts

in OAuth General Discussion YDN SDKs