Skip to content

Instantly share code, notes, and snippets.

@manoj-choudhari-git
Created January 30, 2020 20:52
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 manoj-choudhari-git/a4a4d58714f744a180539d3b51f9557e to your computer and use it in GitHub Desktop.
Save manoj-choudhari-git/a4a4d58714f744a180539d3b51f9557e to your computer and use it in GitHub Desktop.
JWT Authentication - Startup Configure Method
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseCors(x => x
.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader());
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseHttpsRedirection();
app.UseRouting();
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