litl / rauth

A Python library for OAuth 1.0/a, 2.0, and Ofly.
http://readthedocs.org/docs/rauth/en/latest/
MIT License
1.61k stars 175 forks source link

Yahoo Boss Signature #182

Open macedd opened 9 years ago

macedd commented 9 years ago

Despite being configured properly, headers sent, signature generated, etc Yahoo boss api keep throwing an error

u'Please provide valid credentials. OAuth oauth_problem="signature_invalid", realm="yahooapis.com"

Here is the code

from rauth import OAuth1Service

key = ''
secret = ''

yahoo = OAuth1Service(
    name='yahoo',
    consumer_key=key,
    consumer_secret=secret)

session = yahoo.get_session()
req = session.request('GET', 'https://yboss.yahooapis.com/ysearch/web?q=search&start=0&format=json', True, 'yahooapis.com')

print req.json()
print req.request.body
print req.request.url
print req.request.headers

Sounds like the signature is not generating properly for the consumer

https://developer.yahoo.com/boss/search/boss_api_guide/oauth.html

josuebrunel commented 9 years ago

Hello @thiagof , may be you should give a shot to yahoo-oauth which based on rauth. It supports OAuth1 and OAuth2

jmgamboa commented 8 years ago

@thiagof ever resolve this? I do not see you the part where you are signing the request in your code

macedd commented 8 years ago

Couldnt solve. Think I've done my own class using requests_oauthlib

josuebrunel commented 8 years ago

@jmgamboa @thiagof could you please make sure you have the right consumer key and secret. The default consumer key and consumer secret won't work for. As for yahoo gemini, yahoo boss requires special credentials ( You need to pay for them ). If it still doesn't work you can check the issue #183