DEV Community

Discussion on: Developing token authentication using ASP.NET Core

mrcehlo profile image

Thank you for the article, it helped me a lot understanding Token generation/validation as I am new to all this core universe.
I have a question though related with the middleware necessity. As you provided a route for the token generation (/api/token), I ask myself if another approach wouldn't be the implementation of the TokenProviderOption class as a Configuration/Option object as explained in this Microsoft doc ( letting the TokenController manage token generation instead of creating a Middleware, apparently, just to hold the customized options for the token generation process.
I would be grateful for any insights on this matter!