Question

The facebook login using the Facebook C# SDK was working, but now is not! What happened?

I get the user to log in using the Javascript SDK. Then, when I get back to the page, I cannot find the session when I don't ask for the permissions:

(Using only the attribute)
[FacebookAuthorize(
        LoginUrl = "/Admin/Facebook/Login")]

When the attribute is as it should be, it simply doesn't enter the action method:

[FacebookAuthorize(
        LoginUrl = "/Admin/Facebook/Login",
        Perms = "publish_stream,create_event,email,offline_access,read_stream")]

Before I send the user to the action method, I verify using JavaScript that the user is actually logged in and it is always true:

if (response.session) {
        html = response.session.access_token;

        // Tests if necessary permissions are set.
        if (response.perms) {
            var perms = response.perms;

            if (perms.indexOf("publish_stream") != -1
                && perms.indexOf("email") != -1
                && perms.indexOf("create_event") != -1
                && perms.indexOf("offline_access") != -1
                && perms.indexOf("read_stream") != -1

What do you think the problem is?

Was it helpful?

Solution

Have you tried using the latest version of the SDK?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top