POS_Sprint_3 #5

Merged
s426229 merged 10 commits from POS_Sprint_3 into develop 2020-12-30 17:30:24 +01:00
Showing only changes of commit cfb0800065 - Show all commits

View File

@ -42,6 +42,27 @@ namespace Serwer.Api
services.AddSwaggerGen(c => services.AddSwaggerGen(c =>
{ {
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Serwer.Api", Version = "v1" }); c.SwaggerDoc("v1", new OpenApiInfo { Title = "Serwer.Api", Version = "v1" });
var jwtSecurityScheme = new OpenApiSecurityScheme
{
Scheme = "bearer",
BearerFormat = "JWT",
Name = "JWT Authentication",
In = ParameterLocation.Header,
Type = SecuritySchemeType.Http,
Description = "Put **_ONLY_** your JWT Bearer token on textbox below!",
Reference = new OpenApiReference
{
Id = JwtBearerDefaults.AuthenticationScheme,
Type = ReferenceType.SecurityScheme
}
};
c.AddSecurityDefinition(jwtSecurityScheme.Reference.Id, jwtSecurityScheme);
c.AddSecurityRequirement(new OpenApiSecurityRequirement
{
{ jwtSecurityScheme, Array.Empty<string>() }
});
}); });
var hostEnviroment = new HostEnviroment { RootPath = WebRootPath }; var hostEnviroment = new HostEnviroment { RootPath = WebRootPath };