登录以使用Live SDK,Windows应用商店应用 [英] Signing-in to use Live SDK, Windows Store app
问题描述
我正在开发一个应用程序(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应用商店的入门说明:
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:
这篇关于登录以使用Live SDK,Windows应用商店应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!