Set PersistAuthorization to swagger-ui

This commit is contained in:
ngfrolov 2022-04-15 14:45:04 +05:00
parent e95c04c91e
commit 091464a390
2 changed files with 15 additions and 15 deletions

View File

@ -29,7 +29,7 @@ namespace AsbCloudWebApi
Name = "Authorization",
In = ParameterLocation.Header,
Type = SecuritySchemeType.ApiKey,
Scheme = "Bearer"
Scheme = "Bearer",
});
c.AddSecurityRequirement(new OpenApiSecurityRequirement()
@ -45,7 +45,6 @@ namespace AsbCloudWebApi
Scheme = "oauth2",
Name = "Bearer",
In = ParameterLocation.Header,
},
new List<string>()
}

View File

@ -71,6 +71,7 @@ namespace AsbCloudWebApi
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "V1");
c.EnablePersistAuthorization();
});
if (env.IsDevelopment())