Identity in .NET API Makes Auth Easy

There was a time to be scared of the auth in ASP.NET. Identity really makes it easy. But before delving any further, let’s keep the tradition alive by knowing the ancient Roman history of auth in ASP.NET. How Auth was done earlier? Manual Token Generation: Developers manually created JWT tokens using libraries like System.IdentityModel.Tokens.Jwt and hardcoded key management. No Built-in User Management: Handling user registration, login, password hashing, and role management required custom code. Manual Claims Management: Claims (roles, permissions) were added to JWT tokens manually, increasing the risk of errors. Token Validation: Developers manually validated JWT tokens in each request, including signature, expiration, and claims validation. No Built-in Features for Role Management: Handling user roles and claims for authorization were complex It’s not uncommon to see code like this even today (there continue to be valid use cases, of course). ...

Dotnet 6 is Refreshingly Simple

There are numerous things to love about the new .NET 6, but for me one key thing stands out - .NET now seems more approachable than ever! Take a straight-forward example. A new .NET Web API project would look like this - A startup.cs file with generated code A Program.cs file with more lines of code A lot of other files The two file dependencies induced that warm fuzzy feeling in ASP.NET developers for sometime now. ...

A quick start on ASP.NET Core Razor Pages

Here’s a quick introduction to Razor pages in ASP.NET core, and an opinionated way to quickly start building applications using Razor pages. And yes, there is a case for using Razor pages even in 2020. So.. ASP.net? Yes, indeed. I have had a love-hate relationship with ASP.NET through years. I am way less productive using ASP.net but cannot ignore the speed that a dotnet web server provides. Take into account the super debugging capabilities/tooling and the sizeable market that keeps providing projects on the platform, we surely have more than a winner in ASP.NET. ...