C
C#14mo ago
𝕭ourn

✅ 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
JakenVeina
JakenVeina14mo ago
what do you mean when you say "Identity"? cause that can mean about 5 different things
𝕭ourn
𝕭ourn14mo ago
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...
𝕭ourn
𝕭ourn14mo ago
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
JakenVeina
JakenVeina14mo ago
this is an existing ASP.NET project? not ASP.NET Core?
𝕭ourn
𝕭ourn13mo ago
asp net core
Messiah
Messiah13mo ago
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
JakenVeina
JakenVeina13mo ago
the docs you linked all for classing ASP.NET, so you can nix those you want this
JakenVeina
JakenVeina13mo ago
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).
Accord
Accord13mo ago
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.