Skip to content

Instantly share code, notes, and snippets.

@wellingtonjhn
Last active June 10, 2018 06:40
Show Gist options
  • Select an option

  • Save wellingtonjhn/ff57550ad4910165aaaae2ac9a84b84c to your computer and use it in GitHub Desktop.

Select an option

Save wellingtonjhn/ff57550ad4910165aaaae2ac9a84b84c to your computer and use it in GitHub Desktop.
Swagger Auth Config
public void ConfigureServices(IServiceCollection services)
{
services.AddSwaggerGen(options =>
{
// ... código omitido
options.AddSecurityDefinition(
"bearer",
new ApiKeyScheme
{
In = "header",
Description = "Autenticação baseada em Json Web Token (JWT)",
Name = "Authorization",
Type = "apiKey"
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment