Skip to content

Instantly share code, notes, and snippets.

@vaygeth89
Created November 17, 2020 20:32
Show Gist options
  • Save vaygeth89/5f4d74292f9850559aaba30cc55bd40c to your computer and use it in GitHub Desktop.
Save vaygeth89/5f4d74292f9850559aaba30cc55bd40c to your computer and use it in GitHub Desktop.
tutorial-dotnet-JWTProtectedAPI Configure()
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseHttpsRedirection();
app.UseRouting();
//Make sure to add these middlewares
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment