many changes, also Newtonsoft.Json 13.0.a → 13.0.b
This commit is contained in:
@@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.OpenApi.Models;
|
||||
using Microsoft.OpenApi;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||
|
||||
@@ -253,16 +253,23 @@ namespace Sockeye
|
||||
Scheme = "bearer" //The name of the HTTP Authorization scheme to be used in the Authorization header. In this case "bearer".
|
||||
});
|
||||
|
||||
c.AddSecurityRequirement(new OpenApiSecurityRequirement{
|
||||
{
|
||||
new OpenApiSecurityScheme{
|
||||
Reference = new OpenApiReference{
|
||||
Id = "Bearer", //The name of the previously defined security scheme.
|
||||
Type = ReferenceType.SecurityScheme
|
||||
}
|
||||
},new List<string>()
|
||||
}
|
||||
});
|
||||
// c.AddSecurityRequirement(new OpenApiSecurityRequirement{
|
||||
// {
|
||||
// new OpenApiSecurityScheme{
|
||||
// Reference = new OpenApiReference{
|
||||
// Id = "Bearer", //The name of the previously defined security scheme.
|
||||
// Type = ReferenceType.SecurityScheme
|
||||
// }
|
||||
// },new List<string>()
|
||||
// }
|
||||
// });
|
||||
|
||||
c.AddSecurityRequirement(document => new OpenApiSecurityRequirement
|
||||
{
|
||||
// "Bearer" must match the name given to AddSecurityDefinition above
|
||||
[new OpenApiSecuritySchemeReference("Bearer", document)] = []
|
||||
});
|
||||
|
||||
}
|
||||
);
|
||||
services.AddSwaggerGenNewtonsoftSupport();
|
||||
@@ -529,7 +536,7 @@ namespace Sockeye
|
||||
if (!bLocalReportRenderRequest)
|
||||
{
|
||||
context.Response.StatusCode = 401;
|
||||
context.Response.Headers.Add("X-Sockeye-Authorization-Error", "E2004 - Authorization token replaced by more recent login");
|
||||
context.Response.Headers.Append("X-Sockeye-Authorization-Error", "E2004 - Authorization token replaced by more recent login");
|
||||
await context.Response.WriteAsync("E2004 - Authorization token replaced by more recent login");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user