QuickApp
QuickApp copied to clipboard
Swagger does not work with any authorized route
When using Swagger to test routes, any authorized route will return a 401.
Was able to resolve this by adding.
c.AddSecurityDefinition("Bearer", new ApiKeyScheme { In = "header", Description = "Please insert JWT with Bearer into field", Name = "Authorization", Type = "apiKey" }); c.AddSecurityRequirement(new Dictionary<string, IEnumerable<string>> { { "Bearer", new string[] { } } });
And getting the Bearer key in the debug console, after logging in through the password flow in swagger.
Is there a better way to do this?
plz howa u test swagger api