I want to implement JWT authorization for my APIs . I am passing token type as Bearer Token in Authorization tab of the Postman;., this is working perfectly fine through postman
However, I want to implement same on Swagger. How to implement this? I am using .net framework and not Core.
Help would really be appreciated.
Rajkiran SwainPosted Mar 29, 2023, 8:29 PM
To implement JWT authorization in Swagger, you can follow the below steps:
[Authorize]attribute on the controller or action method to enable JWT authorization.This should enable JWT authorization in Swagger for your APIs.
Jignesh KumarPosted Mar 29, 2023, 6:19 AM
https://mattfrear.com/2017/04/27/add-an-authorization-header-to-your-swagger-ui-with-swashbuckle/
Rohan LaghatePosted Mar 29, 2023, 5:45 AM
Hi Jignesh,
I need it for .Net framework and not core.
Jignesh KumarPosted Mar 29, 2023, 5:10 AM
Hello Rohan,
Please refer ,
https://www.c-sharpcorner.com/article/authentication-authorization-using-net-core-web-api-using-jwt-token-and/
https://www.infoworld.com/article/3650668/implement-authorization-for-swagger-in-aspnet-core-6.html
https://code-maze.com/swagger-authorization-aspnet-core/