QuickApp icon indicating copy to clipboard operation
QuickApp copied to clipboard

Swagger does not work with any authorized route

Open n00dl3s opened this issue 7 years ago • 2 comments

When using Swagger to test routes, any authorized route will return a 401.

n00dl3s avatar Jul 07 '18 21:07 n00dl3s

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?

n00dl3s avatar Jul 08 '18 19:07 n00dl3s

plz howa u test swagger api

thomas1008 avatar Mar 19 '21 15:03 thomas1008