Search code examples
asp.net-mvcoauth-2.0asp.net-identityfacebook-login

access_denied while logging into asp.net MVC 5 website using facebook Authentication


I want to login to my ASP.NET MVC app using facebook, and getting an access denied error. Here is what I have done:

I have created an App on: developer.facebook.com, this is the basic settings: enter image description here

I have not changed anything on Advanced, settings.

This is the Facebook Login -> settings (under product) enter image description here

My application is default ASP.Net MVC 5 website, I have uncommented the facebook authentication section in Startup.Auth.cs

app.UseFacebookAuthentication(
           appId: ConfigurationManager.AppSettings["FacebookAppId"],
           appSecret: ConfigurationManager.AppSettings["FacebookAppSecret"]);

When I go to the login page, it redirects me to facebook login page:

enter image description here

And then I am redirected back to the login page... no user is registered in the database... I know my DB registration is working because users can login with the same process using google...

I am getting access_denied in facebook response.


Solution

  • I had not installed: Microsoft.Owin.Security.Facebook Nuget Package, it works now, after I installed the package.