Skip to content

Instantly share code, notes, and snippets.

@fmshk97
Last active February 20, 2021 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fmshk97/1d2174e10d0ee701d39c28d70dc7e144 to your computer and use it in GitHub Desktop.
Save fmshk97/1d2174e10d0ee701d39c28d70dc7e144 to your computer and use it in GitHub Desktop.
Add authentication middleware in application's pipeline
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
// Below line adds the authentication middleware in our app's pipeline
app.UseAuthentication();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment