开发者

Facebook Developer Toolkit doesn't redirect after authorization

开发者 https://www.devze.com 2022-12-24 17:44 出处:网络
I have a small facebook test app (iframe) based on sample http://blogs.claritycon.com/blogs/kevin_marshall/archive/2009/1开发者_运维技巧0/06/facebook-developer-toolkit-3-0-asp-net-mvc-sample.aspx

I have a small facebook test app (iframe) based on sample http://blogs.claritycon.com/blogs/kevin_marshall/archive/2009/1开发者_运维技巧0/06/facebook-developer-toolkit-3-0-asp-net-mvc-sample.aspx

public class HomeController : Controller
{
    public ActionResult Index()
    {
        var api = this.GetApi();
        var userId = api.Session.UserId;
        return View();
    }

    // redirects to Index
    // which doesn't redirect back here
    [FacebookAuthorization(IsFbml = false)]
    public ActionResult About()
    {
        var api = this.GetApi();

        // goes here without FacebookAuthorization 
        // but userId = 0
        var userId = api.Session.UserId;
        return View();
    }
}

When I try to go to 'About' page, FacebookAuthorizationAttribute redirects to 'Index' for authentication. The problem is, it never redirects back to 'About'. What am I doing wrong here?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号