Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. services.AddSwaggerGen(c =>
  2. {
  3. c.SwaggerDoc("v1", new Info { Title = "Example API", Version = "v1" });
  4.  
  5. c.AddSecurityDefinition("Bearer", new ApiKeyScheme
  6. {
  7. Description = "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
  8. Name = "Authorization",
  9. In = "header",
  10. Type = "apiKey"
  11. });
  12.  
  13. c.AddSecurityRequirement(new Dictionary<string, IEnumerable<string>>
  14. {
  15. { "Bearer", Enumerable.Empty<string>() }
  16. });
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement