Skip to content

Commit 51386a4

Browse files
committed
Add swagger security definition
1 parent cd8cdfa commit 51386a4

File tree

1 file changed

+7
-0
lines changed
  • aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Host/Startup

1 file changed

+7
-0
lines changed

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Host/Startup/Startup.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
6464
{
6565
options.SwaggerDoc("v1", new Info { Title = "AbpProjectName API", Version = "v1" });
6666
options.DocInclusionPredicate((docName, description) => true);
67+
options.AddSecurityDefinition("bearerAuth", new ApiKeyScheme()
68+
{
69+
Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
70+
Name = "Authorization",
71+
In = "header",
72+
Type = "apiKey"
73+
});
6774
});
6875

6976
//Configure Abp and Dependency Injection

0 commit comments

Comments
 (0)