Menu

1 / 4

ASP.NET Core Authentication Endpoints: Why I Built AuthEndpoints

DEV Community: csharp·Oga·about 14 hours ago
#aqVR5dsk
#devtocsharp#devto#dev#auth#authendpoints
Reading 0:00
15s threshold

AddAuthentication . AddAuthorization . AddCookie . AddJwtBearer . UseAuthentication . UseAuthorization .

In 2022 I started using ASP.NET Core for new projects. I came from Django, where you create a project and auth is already there: a user model, login, logout, password reset, and an admin. However, in aspnetcore I wrote those six lines, ran the app, and had nowhere to log in. There were no aspnetcore authentication endpoints, only the plumbing for them.

The problem: no endpoints

It took me a while to understand why. I read the aspnetcore source and a lot of blog samples. The Add* and Use* calls register the auth services and middleware. They don't give you a single endpoint. Register, login, refresh, 2FA and password reset are all yours to write. To write them, you first have to learn UserManager , SignInManager , token providers and authentication schemes. That's a lot for a beginner.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.