I have an MVC5 application and figured out how to authenticate with facebook using Identity 2.0. Besides adding email to the scope, basically this is the default value:
var options = new FacebookAuthenticationOptions()
{
AppId = "##################",
AppSecret = "######################"
};
options.Scope.Add("email");
app.UseFacebookAuthentication(options);
In another section of my application, it is possible that the user will need to update the facebook token so that he can publish on the wall (I was hoping to just add it options.Scope.Add("publish_stream");). When I cross out the above code and put it inside catchhere ( the facebookdk.net code below ):
try {
var client = new FacebookClient("my_access_token");
dynamic result = client.Get("me/friends");
} catch (FacebookOAuthException) {
// Our access token is invalid or expired
// Here we need to do something to handle this.
}
app. , , . ? , facebookdk.net , Identity 2.0. ? , Identity facebook, , , - , ? , facebook SQL Logins facebook, ? "", .
, ( facebook), . , , , , facebook, , , , ( ).
.