I've followed the steps in the docs to add facebook login to my web app, but I get an error stating that 'AuthenticationBuilder' doesn't contain a definition for 'AddFacebook'.
Steps to reproduce the behavior:
public void ConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(
Configuration.GetConnectionString("DefaultConnection")));
services.AddDefaultIdentity<ApplicationUser>()
.AddDefaultUI(UIFramework.Bootstrap4)
.AddEntityFrameworkStores<ApplicationDbContext>();
services.AddAuthentication().AddFacebook(facebookOptions =>
{
facebookOptions.AppId = Configuration["Authentication:Facebook:AppId"];
facebookOptions.AppSecret = Configuration["Authentication:Facebook:AppSecret"];
});
services.AddMvc()
.AddNewtonsoftJson();
}
You'll need to install the following NuGet Package
https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.Facebook/3.0.0-preview-19075-0444
(This version is for .NET Core Preview 3; If you receive an exception, particularly MissingMethodException you probably have a version mis-match)
Most helpful comment
You'll need to install the following NuGet Package
https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.Facebook/3.0.0-preview-19075-0444
(This version is for .NET Core Preview 3; If you receive an exception, particularly
MissingMethodExceptionyou probably have a version mis-match)