April 2017
Intermediate to advanced
564 pages
24h 7m
English
ASP.NET Core comes up with some out-of-the-box external authentication middleware to authenticate users from Facebook, Twitter, Microsoft account, and Google. To implement Facebook authentication, we have to add a NuGet package--MicrosoftAspNetCore.Authentication.Facebook
Then, add the following code snippet to the Configure method of the Startup class:
app.UseFacebookAuthentication(new FacebookOptions() { AppId = Configuration["your_app_id"], AppSecret = Configuration["your_app_secret"] });
In the preceding code snippet, we are setting the Facebook App ID and Facebook Secret Key using the FacebookOptions object.
Now, when you run your application, it will show the Facebook button, as shown in the following ...
Read now
Unlock full access