SHARE
TWEET

Untitled

a guest Jul 19th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top