0

making oauth calls w/ YUI3's Get.script

Hi,

I am trying to make oauth signed cross-domain calls using YUI3's Get.script to 'https://api.login.yahoo.com/oauth/v2/get_request_token'. I can get a response, but the browser tries to execute the returned json and fails.

In firebug, I can see the generated script node w/ the code i want inside, but I can't get to it. The nodes element in the object passed to my callback function has a length of 1, but when I create a success handler callback fn such as
callback(response){ document.writeln(response.nodes[0].text) }
the callback fires but nothing is displayed.

I've tried adding a callback parameter to the url, but I get an access forbidden error saying my signature is invalid. Are additional parameters allowed with get_request_token? Can I pass in callback function name?

Would another YUI3 tool be more appropriate?

Thank you.

Erik

by
2 Replies
  • QUOTE (Erik @ Nov 11 2008, 08:18 PM) <{POST_SNAPBACK}>
    ,

    I am trying to make oauth signed cross-domain calls using YUI3's Get.script to 'https://api.login.yahoo.com/oauth/v2/get_request_token'. I can get a response, but the browser tries to execute the returned json and fails.


    Hi Erik,

    The OAuth protocol does not support JSON encoded responses. All OAuth server responses are returned only using percent encoding (without any callbacks) as defined in Section 5.3 of the OAuth spec.

    http://oauth.net/core/1.0/#response_parameters

    If you want to use OAuth using Javascript from within a browser based application, you'll need to build a proxy server on your side to translate OAuth into JSON.

    Allen
    0
  • Hi Allen,

    Thanks for the help.

    Erik

    QUOTE (atom @ Nov 19 2008, 05:35 PM) <{POST_SNAPBACK}>
    Hi Erik,

    The OAuth protocol does not support JSON encoded responses. All OAuth server responses are returned only using percent encoding (without any callbacks) as defined in Section 5.3 of the OAuth spec.

    http://oauth.net/core/1.0/#response_parameters

    If you want to use OAuth using Javascript from within a browser based application, you'll need to build a proxy server on your side to translate OAuth into JSON.

    Allen
    0

Recent Posts

in OAuth General Discussion YDN SDKs