Facebook PopUp Login with Owin

倾然丶 夕夏残阳落幕 提交于 2019-12-04 19:54:58

I had the same problem. After reading though the source, I found a solution:

Basically: you need to go ahead and create an authentication provider for Facebook. So create a class that inherits from FacebookAuthenticationProvider. Within this class, override the "ApplyRedirect" method. Make it look something like:

public override void ApplyRedirect(FacebookApplyRedirectContext context)
{
    context.Response.Redirect(context.RedirectUri + "&display=popup");
}

Now simply wire this class up with your configuration, like so:

app.UseFacebookAuthentication(new FacebookAuthenticationOptions
{
    Provider = new **<the name of the class that you created>**()
    // the rest of your configuration such as app ID and secret
});

And that should be it!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!