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

Sebastian Meckovski 25 Reputation points
2024-03-18T18:49:31.74+00:00

I’m working on a relatively simple .NET Core web API service that performs CRUD operations on a database. Not sure what's the best way to implement authentication. Here’s the situation:

  1. In .NET 7, I had to manually define all the authentication endpoints.
  2. In .NET 8, these endpoints come predefined out of the box.

My goal is to create a straightforward set of endpoints for the following actions:

  • Login
  • Register
  • Confirm email (including generating a confirmation link and sending it via SMTP)
  • Reset password
  • Social login with Google

However, .NET 8 also includes additional endpoints (like 2FA) that I don’t need for this project. Also, I want to customize the predefined register controller to trigger an SMTP call for sending the confirmation link.

Questions:

  1. What’s the best approach for achieving my goals?
  2. Should I manually define my own controllers, or can I leverage the .NET 8 predefined ones and selectively disable the ones I don't need? (is that possible)
  3. Can I configure email sending and social login with .NET 8?
  4. Con social login with google be implemented in .NET 8?
  5. Are there any samples that show how to do it?
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,924 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,615 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
343 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 66,706 Reputation points
    2024-03-19T15:52:02.8766667+00:00

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.