April 2017
Intermediate to advanced
564 pages
24h 7m
English
Authentication can be enabled by calling UseIdentity in the pipeline through the Configure method of the Startup class, as follows:
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseIdentity(); app.Run(async (context) => { await context.Response.WriteAsync("Hello World!"); }); }
The app.UseIdentity method adds cookie-based authentication in the pipeline, which means that when the user is authenticated a cookie will be added in the browser and later used for authentication purposes. The App.UseIdentity method internally uses app.UseCookieAuthentication ...
Read now
Unlock full access