外部登录Facebok MVC应用程序

问题描述

我想向我的Asp.net mvc应用程序添加外部Facebook登录名,当我在localhost上运行但当我上载到IIS服务器时,它可以正常工作

var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync(); 

尽管应用程序打开Facebook对话框并获得了我的面部应用程序的权限,但始终返回null

using System;
using MySystem.IdentityModels;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Owin;
namespace MySystem
{
public partial class Startup
{
     public void ConfigureAuth(IAppBuilder app)
    {
        app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
        app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);
        app.UseCookieAuthentication(new CookieAuthenticationoptions
        {
            AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,LoginPath = new PathString("/Users/login"),Provider = new CookieAuthenticationProvider
            {
            }
        });
        app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
        app.UseTwoFactorSignInCookie(DefaultAuthenticationTypes.TwoFactorCookie,TimeSpan.FromMinutes(5));
         app.UseTwoFactorRememberbrowserCookie(DefaultAuthenticationTypes.TwoFactorRememberbrowserCookie);
        // Facebook
        app.UseFacebookAuthentication(
                appId: "XXXXXXXXXXXX",appSecret: "XXXXXXXXXXXXXXXX");

    } 
   }
}

错误是什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)