c# - Twitter OAuth "Could not authenticate you" when I specify a callback url -
i'm having issue twitter oauth 1.0 during request_token
stage
if set oauth_callback
of oob (or omit callback url) works fine, of course doesnt redirect user web app afterwards.
n.b. may going wrong way. want specify url client browser should directed after having authorized oauth request on twitter
as change oauth_callback app's callback url, error "could not authenticate you"
i have setup callback url in app settings on twitter same url 1 settings in oauth_callback parameter of request_token process fyi https base url i.e. no path specified, https://www.example.com/
any assistance appreciated
update
this request works (no callback url specified @ all):
post https://api.twitter.com/oauth/request_token http/1.1 authorization: oauth oauth_consumer_key="----myconsumerkey----", oauth_nonce="r70s1926", oauth_signature="ifgmxepdav0lvpge9ls9acgi6r0%3d", oauth_signature_method="hmac-sha1", oauth_timestamp="1503053275", oauth_version="1.0"
this request not (callback url specified, same twitter app setting):
post https://api.twitter.com/oauth/request_token http/1.1 authorization: oauth oauth_callback="https%3a%2f%2fwww.example.com", oauth_consumer_key="----myconsumerkey----", oauth_nonce="707n8282", oauth_signature="0kwzejwq%2fnmfmdz%2bt0zneu4g3ag%3d", oauth_signature_method="hmac-sha1", oauth_timestamp="1503053306", oauth_version="1.0"
the request above returns:
{"errors":[{"code":32,"message":"could not authenticate you."}]}
because exclusion or setting of oob works sounds encoding problem within signature generation.
check oauth_callback url double encoded within signature base string should like:
post&https%3a%2f%2fapi.twitter.com%2foauth%2frequest_token&oauth_callback%3dhttps%253a%252f%252fwww.example.com%26oauth_consumer_key%3dmyconsumerkey%26oauth_nonce%3d707n8282%26oauth_signature_method%3dhmac-sha1%26oauth_timestamp%3d1503057157%26oauth_version%3d1.0
Comments
Post a Comment