登录以使用Live SDK,Windows应用商店应用 [英] Signing-in to use Live SDK, Windows Store app

查看:90
本文介绍了登录以使用Live SDK,Windows应用商店应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

我正在开发一个应用程序(Windows Store )访问SkyDrive内容。

要登录直播我使用下面的代码片段。

尝试
{

var uri = " https://login.live.com/oauth20_authorize.srf" ;
var authorizeUri = StringBuilder uri );

authorizeUri
AppendFormat "?client_id = {0}&" " 000000004C0 ****" ); //这是我的客户ID
authorizeUri
AppendFormat " scope = {0}&" " wl.signin" );
authorizeUri
AppendFormat " response_type = {0}&" " code" );
authorizeUri
AppendFormat " redirect_uri = {0}" " http://www.redirect_url.com" ));
LiveAuthClient auth = LiveAuthClient authorizeUri ToString ());

LiveLoginResult loginResult = await auth LoginAsync 字符串 [] { " wl.basic" });
如果 loginResult != null
{
如果 loginResult 状态 == LiveConnectSessionStatus 已连接
{
这个 txtStatus 文字 = "登录" ;
}
}
}
catch LiveAuthException 异常
{
这个 txtStatus 文字 = exception 消息 + "错误" ;
}
}

有了这个,我总是得到以下异常:"应用程序未正确配置使用Live Connect服务...."

我试图获得我的Windows应用商店应用程序的包装身份。因为它带我到付费注册页面,我还没有这样做。我不确定这是否是问题的原因。

如果我能帮助解决这个问题我很感激。



解决方案

此处有特定于Windows应用商店的入门说明:


http://msdn.microsoft.com/en-us/library/live/hh826551.aspx


I am developing an application (Windows Store) to access SkyDrive content.

To login to Live I am using the below code snippet.

try { var uri = "https://login.live.com/oauth20_authorize.srf"; var authorizeUri = new StringBuilder(uri); authorizeUri.AppendFormat("?client_id={0}&", "000000004C0****"); //This is my Client ID authorizeUri.AppendFormat("scope={0}&", "wl.signin"); authorizeUri.AppendFormat("response_type={0}&", "code"); authorizeUri.AppendFormat("redirect_uri={0}", ("http://www.redirect_url.com")); LiveAuthClient auth = new LiveAuthClient(authorizeUri.ToString()); LiveLoginResult loginResult = await auth.LoginAsync(new string[] { "wl.basic" }); if (loginResult != null) { if (loginResult.Status == LiveConnectSessionStatus.Connected) { this.txtStatus.Text = "Signed in"; } } } catch (LiveAuthException exception) { this.txtStatus.Text = exception.Message+ " Error"; } }

With this I am always getting the below exception: "The app is not configured correctly to use Live Connect services. ..."

I tried to get Package identity for my Windows Store app. Since, it is taking me to paid registration page, I have not done that. I am not sure if that is the cause for the problem.

I appreciate if I could get help in resolving this issue.


解决方案

There are Windows Store-specific Getting Started instructions here:

http://msdn.microsoft.com/en-us/library/live/hh826551.aspx


这篇关于登录以使用Live SDK,Windows应用商店应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆