问题
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?
回答1:
This problem can also occur if you are using a proxy server. Using "Automaticaly detect settings" in LAN settings fixed this issue for me.
来源:https://stackoverflow.com/questions/19383328/live-connect-authentication-status-always-unknown