2

in my application written for Windows 8 I authenticate via Facebook. I would like to do so that you do not have to entering your credentials every time. I was able to write to a file user's access token, but I can not check if it is still active. I need something like this - if (_fb.TryLoginWithStoredToken (storedToken)) {.... }.

If it returns false then throw the normal Facebook login window, ie are:

loginUrl var = _fb.GetLoginUrl (new
                 {
                     client_id = _facebookAppId,
                     redirect_uri = redirectUrl,
                     scope = _permissions,
                     display = "popup"
                     response_type = "token"
                 });
                 endUri var = new Uri (redirectUrl);
                 WebAuthenticationResult await WebAuthenticationBroker.AuthenticateAsync WebAuthenticationResult = (
                                                         WebAuthenticationOptions.None,
                                                         loginUrl,
                                                         endUri);
                 if (WebAuthenticationResult.ResponseStatus == WebAuthenticationStatus.Success)
                 {
                     callbackUri var = new Uri (WebAuthenticationResult.ResponseData.ToString ());
                     _fb.ParseOAuthCallbackUrl facebookOAuthResult = var (callbackUri);
                     accessToken var = facebookOAuthResult.AccessToken;

I hope this is possible, if not, maybe you have a better idea how to get this effect;)

4

1 に答える 1

1

残念ながら、現時点では、Facebook はこれを可能にするために必要なシングル サインオンの redirect_uri をサポートしていません。そのため、これは不可能です。

于 2013-03-18T01:44:42.610 に答える