Hi all.
Could someone please explain me how to sign Requests using "Authorization" Header? I'm new to Yahoo API and OAuth
My app successfully passes OAuth flow and receives token, token_secret, user's guid. I found following in yahoo documentation:
1. GET
http://social.yahooapis.com/v1/user/abcdef...ile?format=json 2. Authorization: OAuth
3. realm="yahooapis.com",
4. oauth_consumer_key="dj0yJmk9nM9Y29uc3VtZXJzZWNyZXQmeD1lMg--",
5. oauth_nonce="24829.2331",
6. oauth_signature_method="HMAC-SHA1",
7. oauth_timestamp="1219450170",
8. oauth_token="A%3DuqkiebGpiTJl7ThQxU.jDXXaETYyfEy3xAKPyoavokwOOcZcz8Xs_l1Nvnl._
9. KmCEVCeLkxxT1Y6BgRqf5f98sQWHklBM_anetveR7okK_M_5XEmQ1_1reo3UgKQULT_dQT8Gao3.
10. Rrgz5rJxgmnYrhdWWdfgTdMQVzpbJT2aGkz59NTK1O8yXVE1EvZUCqju7WiFYu.WHNEw.9TWq3g--",
11. oauth_version="1.0",
12. oauth_signature="O2AQipLITO0aYHKZc9266RzC94%3D"
this is what I need. I compose string "OAuth realm .....etc" and paste my consumerKey, generate and paste random nonce, timestamp, paste my token, generate and paste signature. But when I add this as "Authorization" header and send request server responces 401: Unauthorized.
Here is the string I get:
AuthOAuth realm="yahooapis.com", oauth_consumer_key="dj0yJmk9TDJoUUllcGE5T0RYJmQ9WVdrOU0yWnhZWE5ITm0wbWNHbzlOalV4TkRBNE56VTMmcz1
jb25zdW1lcnNlY3JldCZ4PWFj", oauth_nonce="7875305", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1244195207", oauth_token="A%3dErwaU8uerDiQeyz1oB6SnzeqwYGKnERLUce0m5xhWRg9Ks2aGcy96pc3n69YvGFj8jZWDvWmxzybcC
qTriVHBf8IvIxS_JZDx6PWtlhLB1P9U2kS7KyU32uSRsfBw4tUjWLrLuI8wtoEIIwxx5L5qVIbeSpzep
t
5TsO5VL7MIvQv_BGaChcmzi5K_axVk_VWCZWoWIe4oWIwdkcAQXpUMitrn15lU3.WrYHdX62_aV2KaG1
N
C6PZLuEwfeqXw5OqkAjWKfJY_s2NBZT7NhszipccN5FzNjJk8851rzKKZIsSMvi8cT5pWjPU2OkX2ByJ
m
_j2xi1L0DfzhHci3R42MO31nCzcLmEQlOKN0RDPAbS2ItXqYjRvoutEDxSv_3mLaOLGkT8FXBBv35Cxo
H
4kORvS_tOiEE49KYZ4q.cWNkzviEX4tRLYCc3cNLSuGV.HlFrNl8yqscc.vZ3nfDzA4fGs.7nRILFG74
V
QxE5GVmVJR2uB0XpMgRJiRK0C93osNsTtNaYf.O7mn.q5oingydzBF_xpcjKye5JfjmkczBdpXYPUQ4i
R
T42FAzp6WOkquAen5owi1x4gzBWXR2cQ3zVjoSb0lLOXFYIJYFcI2O77M2C6bB.wgpLOZFjVGPf46VCm
H
kUWxtwspYp5FXIrHGvFyU2cl8aECVaOWnfSMlD1l7EHoTcaI5jZvN2wtUNxM..3qrzn0o1oBcJHWMAsY
H
i0TCCz", oauth_version="1.0", oauth_signature="dUZ%2f1RR%2f218XdmiZVr8ZjX%2fNGXU%3d"
I use OAuthBase.cs C# library to generate nonce, timestamp and signature.
maybe I do something wrong? where should I get parameters for header? Maybe they must be the same as I used when passing OAuth? I tried, but didn't help.
Thank you for your replies.