File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,6 +84,30 @@ public void ConfigureServices(IServiceCollection services)
8484 Email = "DbLocalizer@gmail.com"
8585 }
8686 } ) ;
87+ options . AddSecurityDefinition ( "Bearer" , new OpenApiSecurityScheme
88+ {
89+ Name = "Authorization" ,
90+ Type = SecuritySchemeType . ApiKey ,
91+ Scheme = "Bearer" ,
92+ BearerFormat = "JWT" ,
93+ In = ParameterLocation . Header ,
94+ Description = "Enter 'Bearer' followed by your token in the text input below.\n Example: Bearer <your_token>"
95+ } ) ;
96+
97+ options . AddSecurityRequirement ( new OpenApiSecurityRequirement
98+ {
99+ {
100+ new OpenApiSecurityScheme
101+ {
102+ Reference = new OpenApiReference
103+ {
104+ Type = ReferenceType . SecurityScheme ,
105+ Id = "Bearer"
106+ }
107+ } ,
108+ new string [ ] { }
109+ }
110+ } ) ;
87111
88112 var xmlFilename = $ "{ Assembly . GetExecutingAssembly ( ) . GetName ( ) . Name } .xml";
89113 options . IncludeXmlComments ( Path . Combine ( AppContext . BaseDirectory , xmlFilename ) ) ;
You can’t perform that action at this time.
0 commit comments