Setting up the Facebook Authentication service

Once NuGet is done, open the Startup.cs file, scroll down until we reach the ConfigureServices method, and add the Facebook service in the following way (relevant lines are highlighted):

[...]// Add Authenticationservices.AddAuthentication(opts =>{    opts.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;    opts.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;    opts.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;})// Add Jwt token support.AddJwtBearer(cfg =>{    cfg.RequireHttpsMetadata = false;    cfg.SaveToken = true;    cfg.TokenValidationParameters = new TokenValidationParameters()    {        // standard configuration        ValidIssuer = Configuration["Auth:Jwt:Issuer"], IssuerSigningKey ...

Get ASP.NET Core 2 and Angular 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.