Stuart Smith
Stuart Smith

Reputation: 1

Facebook C# SDK Sample MVC App About page gets in a loop

When I click on the About tab in the sample MVC app it seems to get into a continual loop calling apps.facebook.com/xxxx/Home/About. I can see from the browser address url that it calls http://localhost:nnnn/facebookredirect.axd/xxxx/Home/About/.....

If I click the Home tab then it all seems to work OK and asks for my Facebook login details.

What am I doing wrong?

Thanks

Upvotes: 0

Views: 725

Answers (2)

Stuart Smith
Stuart Smith

Reputation: 33

I didn't have the OATH 2.0 for Canvas enabled.

Upvotes: 2

Vova Bilyachat
Vova Bilyachat

Reputation: 19514

Which version are you using?

probably issue is that you ask return token

            var parameters = new Dictionary<string, object>();
            parameters["scope"] = Settings.Current.FacebookScope;
            parameters["redirect_uri"] = string.IsNullOrEmpty(_url) ?  Url : _url;
            parameters["client_id"] = AppId;
            string url = oauth.GetLoginUrl(parameters).OriginalString;

then get token

var fb = new FacebookClient();

            dynamic result = fb.Get("oauth/access_token", new
            {
                client_id = AppId,
                client_secret = AppSecret,
                redirect_uri = Url,
                code = FacebookUtils.FacebookData.Code
            });

Upvotes: 0

Related Questions