Guest User

Untitled

a guest
May 21st, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. services.AddSwaggerGen(o =>
  2. {
  3. var security = new Dictionary<string, IEnumerable<string>> { { "Bearer", new string[] { } }, };
  4. o.AddSecurityRequirement(security);
  5.  
  6. o.AddSecurityDefinition("Bearer", new ApiKeyScheme
  7. {
  8. Description = "权限认证(数据将在请求头中进行传输) 参数结构: \"Authorization: Bearer {token}\"",
  9. Name = "Authorization",
  10. In = "header",
  11. Type = "apiKey"
  12. });
  13. });
Add Comment
Please, Sign In to add comment