C
C#3mo ago
CoffeeBot

JWT tutorials.

Hi guys, I'm new to C# and was looking to learn authentication and authorization for WEB APIs. From what I understand a lot has changed in .NET 8 so any tutorials before that won't be helpful (my assumption, please tell me if wrong), and while I can find a fair few resources for implementing auth with Identity and Bearer tokens, I can't find much for JWT. Whatever little I have found, doesn't seem to work. So, if you have any recommendations on resources or ways that I could approach this, then it would be greatly appreciated. Thanks.
2 Replies
ineternet
ineternet3mo ago
what do you mean not work? the (slightly) outdated asp.net docs from microsoft about JWTs should still work in .net 8, what are you having issues with?
CoffeeBot
CoffeeBot3mo ago
Different problems with different tutorials that I can't seem to solve. For example, I followed this article https://medium.com/@codewithankitsahu/authentication-and-authorization-in-net-8-web-api-94dda49516ee, and while the logging in and getting a token back works, I am unable to register a new user. It says that I need to provide a password even though I already am. In some other tutorials I was trouble with adding migrations, so on and so forth. I can't seem to find any microsoft docs about JWT. Can you please link the ones you are talking about? Also, sorry for the late reply. Got busy with work.