0

I am trying to implement a SoundCloud app for blackberry phones using webworks frame work.

I am using OAuth2 scheme for authorization. So far I am able to display the SoundCloud log-in page from where the user can allow the app. But the problem occurs during the redirect which is essentially done by SoundCloud. The redirect page which is being pointed to by the call back URI is residing in my device, but after the user approves the app I get a page saying "something went wrong". However when I try to bounce the redirect from a third server, it just works fine. In this case I specify the callback URL pointing to a page on a website which only forwards the request to the page which is residing on my device. But the problem is that I do not want to use this "bounce server"

Could you please look into the code and advise if I am doing something wrong.

/**
 * Authenticates the app against soundcloud
 * This javascript method is called in the index.htm of my application.
 */
authenticate : function(){
    var url = "https://soundcloud.com/connect?" + "scope=nonexpiring&client_id=MY_CLIENT_ID&" +
              "response_type=code&redirect_uri=local:///testpage.htm";
    window.location = url;
;

/************************************/

testpage.htm only displays "hello sound cloud".

Any help in this regard shall be highly appreciated.

4

2 回答 2

1

redirect_uri参数的值必须与应用编辑页面上的“重定向 URI”的值匹配。

示例:https ://img.skitch.com/20120411-q6yqada29tcadnep15jc6q75a1.jpg

IHTH 汉内斯

于 2012-04-11T09:58:22.717 回答
0

问题是redirect_uri 中的三斜杠部分。尽管根据RFC 3986它是一个有效的 URI ,但 Ruby URI 库在解析此类值时表现得有些奇怪。我们正在努力修复。

同时,您可以尝试使用 local:/testpage.htm 吗?

于 2012-04-11T10:30:03.630 回答