Windows 8 Windows 8应用程序Web代理中的SoundCloud

Windows 8 Windows 8应用程序Web代理中的SoundCloud,windows-8,soundcloud,webbroker,Windows 8,Soundcloud,Webbroker,SoundCloud api不允许从Windows 8 Javascript Web代理登录。我使用的是Windows 8任意服务web代理示例我已使用该类连接了Windows应用商店应用程序,但这是用C#编写的,希望它能有所帮助: WebAuthenticationResult war = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, startUri, endUri); star

SoundCloud api不允许从Windows 8 Javascript Web代理登录。我使用的是Windows 8任意服务web代理示例

我已使用该类连接了Windows应用商店应用程序,但这是用C#编写的,希望它能有所帮助:

WebAuthenticationResult war = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, startUri, endUri);
startUri是对/connect端点的调用,endUri是回调uri

然后,您可以处理响应并调用/oauth2/token端点以获取访问令牌:

switch (war.ResponseStatus)
{
    case WebAuthenticationStatus.Success:
    {
        string response = war.ResponseData;
        string[] responseSplit = response.Split('=');
        string authCode = responseSplit[1];
        // call /oauth2/token with the authorisation code...
        break;
     }
     case WebAuthenticationStatus.UserCancel:
     {
         OutputMessage(war.ResponseStatus.ToString());
         break;
     }
     case WebAuthenticationStatus.ErrorHttp:
     {
         OutputMessage(war.ResponseStatus.ToString());
         break;
     }
}
希望您可以将其读入JavaScript


祝你一切顺利

你能展示一下你用来启动登录的代码吗?谢谢