Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- services.AddSwaggerGen(o =>
- {
- var security = new Dictionary<string, IEnumerable<string>> { { "Bearer", new string[] { } }, };
- o.AddSecurityRequirement(security);
- o.AddSecurityDefinition("Bearer", new ApiKeyScheme
- {
- Description = "权限认证(数据将在请求头中进行传输) 参数结构: \"Authorization: Bearer {token}\"",
- Name = "Authorization",
- In = "header",
- Type = "apiKey"
- });
- });
Add Comment
Please, Sign In to add comment