.NET Authentication .NET 7 Vs .NET 8 in my simple API service

53 Views Asked by At

I'm building a relatively simple .NET core web API service that does some CRUD operations on a database. I'm a bit confused about implementing authentication. It looks like in .NET 7 you have to manually define all the endpoints, but in .NET 8 they are already defined out of the box.

I want to have a simple set of endpoints for the following actions:

  • login
  • register
  • confirm email (generate confirm email link and send via SMTP)
  • reset password
  • social login with google (not sure if that has anything to do with my question, but I'll mention that)

I tried implementing authentication in .NET 8 and I expected that it can all be configured, but it also comes with some other endpoints like 2fa which I don't want to use for this project. I'm also not sure how can I edit the predefined .NET 8 register controller because that's where I want to trigger the SMTP call to sent the confirm link.

What's the best route to take - should I define my Controllers manually or should I just use .NET 8 predefined controllers and somehow disable the ones I don't need and edit the one that I need? Is the .NET 8 out of the box package configurable enough to achieve my goals?

0

There are 0 best solutions below