I am trying to add authentication to my application, I have an entity framework, but now I would like to authenticate the user, but I have many problems setting it up in the configure constructor.
For example, in many tutorials they provide code that no longer works, as if I were doing
// Configure ASP.NET Identity to use our Identity-based application context services.AddAuthentication() .AddIdentity() .AddEntityFrameworkStores() .AddDefaultTokenProviders();
He tells me that I need to explicitly specify type arguments, but is that what is in the tutorial?
https://shellmonger.com/2015/05/29/asp-net-mvc5-identity-part-1-the-database/
Itβs hard for me to understand how to do it right, all I want to do is authenticate the user when he / she logs in.
Here is my project.json
"dependencies": { "EntityFramework.Commands": "7.0.0-rc1-final", "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final", "EntityFramework.Core": "7.0.0-rc1-final", "Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final", "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final", "Microsoft.AspNet.Identity": "3.0.0-rc1-final", "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final", "Microsoft.AspNet.Authentication": "1.0.0-rc1-final", "Microsoft.AspNet.Authorization": "1.0.0-rc1-final", "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final", "Microsoft.AspNet.Mvc": "6.0.0-rc1-final", "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", "Microsoft.AspNet.Server.WebListener": "1.0.0-rc1-final", "Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final", "Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta5", "Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4", "Microsoft.Framework.Logging": "1.0.0-beta7", "Microsoft.Framework.Logging.Console": "1.0.0-beta8", "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final" },
and my configuration:
public class Startup { public IConfigurationRoot Configuration { get; set; } public Startup() { var builder = new ConfigurationBuilder() .AddJsonFile("config.json") .AddJsonFile($"config.json", optional: true); builder.AddEnvironmentVariables(); Configuration = builder.Build(); }
Any help would be appreciated, my ideas are running out, I tried several other sites with the same result (did this make a change?).