asp.net - Generate token into swagger api_key field in ASP Core 1.0 -
i added swagger api core, , added button "authorize" field "api_key" put jwt bearer token.
i'd generate token when arrive on swagger page , validate token have "ready use" swagger.
this code used create "authorize" button @ top :
services.addswaggergen(c => { c.swaggerdoc("v1", new info { title = "acccountsapi", version = "v1" }); c.addsecuritydefinition("bearer", new apikeyscheme() { in = "header", description = "please insert jwt bearer field", name = "authorization", type = "apikey" }); });
i'm using "swashbuckle".
Comments
Post a Comment