当前位置: 动力学知识库 > 问答 > 编程问答 >

login - Live Connect authentication status always "Unknown"

问题描述:

I'm facing some problem when authenticating in my WP8 app via Live SDK.

I have added a SignInButton to my app:

<live:SignInButton x:Name="btnSignIn"

Scopes="wl.skydrive wl.skydrive_update wl.signin wl.offline_access"

ClientId="MY_CLIENT_ID"

SessionChanged="btnSignIn_SessionChanged"

TextType="Login" />

In the code-behind I have the following:

private async void btnSignIn_SessionChanged(object sender, Microsoft.Live.Controls.LiveConnectSessionChangedEventArgs e)

{

App.LiveSession = e.Session;

if (e.Status == Microsoft.Live.LiveConnectSessionStatus.Connected)

{

App.LiveClient = new Microsoft.Live.LiveConnectClient(e.Session);

}

}

When I tap the SignIn button, I show the screen where I enter my credentials, and give permissions to the app. Everything fine until there.

The problem is that after that, btnSignIn_SessionChanged is fired, as expectyed, but I always get Unknown in e.Stautus property.

If I tap the SignIn button again, I'm not asked for credentials, but yes for permission. After accepting, e.Status keeps returning Unknown, when it should be Connected.

In http://dev.live.com I have my app configured as mobile client. The app used to work in the past, and I'm not able to guess where can be the problem.

Any clue?

网友答案:

This problem can also occur if you are using a proxy server. Using "Automaticaly detect settings" in LAN settings fixed this issue for me.

网友答案:

wl.offline_access can not used with SignInButton. also make sure you clientid is works.

分享给朋友:
您可能感兴趣的文章:
随机阅读: