[2.0] using OAUTH 1.0 to access Yahoo APIs

84 views
Skip to first unread message

MG

unread,
May 3, 2012, 5:11:58 PM5/3/12
to play-fr...@googlegroups.com
Hello - I am trying to retrieve data from Yahoo APIs using OAUTH 1.0. I am able to get the user to authorize the data access and get the access token. However, I am stuck after that step. Yahoo requires requests to be signed with SHA-1 and I am unable to send a properly signed request. Here is the URI that I am trying to access:"http://social.yahooapis.com/v1/me/guid"

A couple of options I have tried:
1) Use the OAuthCalculator class to sign: WS.url(GuidURL).sign(OAuthCalculator(KEY, t)).get()
When I do this, the app never gets back any result and shows a blank screen.

2) Sign the header my self using the Crypto library. Should I just retrieve the WSRequestHolder.headers and sign it?

Can you please point me in the right direction? Thanks.

-MG

MG

unread,
May 3, 2012, 9:39:44 PM5/3/12
to play-fr...@googlegroups.com
Looking at the play source code, it looks like using OAuthCalculator is the right approach to sign a request. And I figured out why the application crashes when I uses. Apparently Yahoo is sending back an incorrectly formed response that cannot be handled by the play server. Here is the log message:

Waiting for a promise, but got an error: "utf-8"
java.io.UnsupportedEncodingException: "utf-8"

Is there a work-around or a solution to this issue? Thanks.
Message has been deleted

wilOpen

unread,
May 9, 2012, 12:14:13 PM5/9/12
to play-fr...@googlegroups.com
Hi, i have the same problem, did oyou resolev it?

MG

unread,
May 18, 2012, 12:02:18 PM5/18/12
to play-fr...@googlegroups.com
Unfortunately not yet. Somebody pointed out that it is a bug in the Netty library that Play uses. Apparently, it has been fixed in the library, but it has not made it to the Play repo. I am thinking of downloading the updated Netty library directly, but not sure how to do it.

Did you come up with any workaround?

MG

unread,
May 18, 2012, 12:17:05 PM5/18/12
to play-fr...@googlegroups.com
Sorry, the bug is not in the Netty library, but the Async Http Client (https://github.com/sonatype/async-http-client/issues/52)
Reply all
Reply to author
Forward
0 new messages