简体   繁体   中英

Facebook OAuth: Callback URI gives me an HTTP ERROR 500

So I am pretty much using the default MVC-template that includes OAuth authentication with facebook. But after authenticating I am getting an HTTP ERROR 500 .

I am using OAuth Version 4.0. My ConfigureAuth looks like this:

public void ConfigureAuth(IAppBuilder app)
{
    app.CreatePerOwinContext(ApplicationDbContext.Create);
    app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);

    // Local Login Cookie
    app.UseCookieAuthentication(new CookieAuthenticationOptions
    {
        AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
        LoginPath = new PathString("/Account/ExternalLogin"),
        ExpireTimeSpan = TimeSpan.FromDays(3),
    });

    app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);

    // Facebook
    var facebookOptions = new FacebookAuthenticationOptions
    {
        AppId = "[MY APP ID]",
        AppSecret = "[MY APP SECRET]",
        CallbackPath = new PathString("/Account/ExternalLoginCallback"),
    };

    app.UseFacebookAuthentication(facebookOptions);
}

In my facebook app I have added https://localhost:44365/Account/ExternalLoginCallback to my valid OAuth Redirect URIs.

I have searched for an answer but couldnt find anything. What am I missing?

As of March 2018 Strict mode is enabled by default. Add the following callback URIs in your facebook App settings:

http://localhost:44365/

http://localhost:44365/ExternalLoginCallback

http://localhost:44365/signin-facebook

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM