✅ Add Identity to existing ASP.NET Web API
Hello everyone!
I have an existing web api project, to which i want to add Identity. I'm working on a chat application, which uses SignalR for realtime communication. Currently, messages are broadcasted to anyone subscribed to the SignalR Hub managing conversations. Doing my research, looks like with Identity you can directly send a message to a specific user, by its username (instead of using its Context.connectionId or the single-groups hack). But i have no idea of how Identity works, and how to configure it. Can someone help me understand more of this topic?
I also want to mention that i'm using MySQL as my main database, and configured the generation of JWT tokens.
9 Replies
what do you mean when you say "Identity"?
cause that can mean about 5 different things
@ReactiveVeina I'll link an article to be clear
https://learn.microsoft.com/en-us/aspnet/identity/overview/getting-started/introduction-to-aspnet-identity
Introduction to ASP.NET Identity - ASP.NET 4.x
The ASP.NET membership system was introduced with ASP.NET 2.0 back in 2005, and since then there have been many changes in the ways web applications typicall...
Basically, from what i've understood so far, it's a full-blown auth system built into asp.net core. As i've said, i'm new to it an quite frankly i don't even know if i really need it
this is an existing ASP.NET project?
not ASP.NET Core?
asp net core
I'm pretty sure it's just a matter of adding builder.services.AddAuthentication() and asp.net starts using it
but the library is huge and hugely abstracted
the docs you linked all for classing ASP.NET, so you can nix those
you want this
Introduction to Identity on ASP.NET Core
Use Identity with an ASP.NET Core app. Learn how to set password requirements (RequireDigit, RequiredLength, RequiredUniqueChars, and more).
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.