Implementing .net Auth/Identity

I'm having some trouble with implementing .net Identity related features https://paste.mod.gg/kwlujwqjjojv/2 current error is an exception relating to service not being constructed it's in the error page on blazebin If someone can nudge me in the right direction here ? have a hard time understanding how it fits together in my specific context
BlazeBin - kwlujwqjjojv
A tool for sharing your source code with the world!
8 Replies
D.Mentia
D.Mentia3mo ago
app.UseRouting();

app.UseAuthentication();
app.UseAuthorization();
app.UseRouting();

app.UseAuthentication();
app.UseAuthorization();
These have to be done in that specific order, I think you missed UseAuthentication Unsure if UseRouting is specific to a certain flavor of asp.net without controllers, there's so many ways to do ASP.net, but I'm guessing UseAuthentication is the missing piece If it's not that IDK, my auth stuff looks very different but I've been doing it on blazor server
studentoffuturearts
Thanks for the reply seems i already had useAuthorization(); added the other 2 above the line, but not working yet
D.Mentia
D.Mentia3mo ago
Authentication and Authorization are different things, I think you'd need both. Maybe take out UseRouting, I think your MapControllers is the same thing but for MVC But yeah, if that's not it then, not sure
studentoffuturearts
Ahead of you =D, already commented out useRouting, but same thing
D.Mentia
D.Mentia3mo ago
I remember trying to mess with it multiple times and always got so annoyed because there's 10 different instructions for how to do it and none of them matched my 'flavor' of ASP.net part of why I swapped to blazor lol, at least there's only one set of instructions for blazor (even if that's also still just another asp.net flavor)
studentoffuturearts
Get you, hence my confusion at this, i have no idea what exactly it expects and find lots of conflicting info is blazor easy to implement then?
D.Mentia
D.Mentia3mo ago
I really like it, but you gotta keep in mind security concerns because most of the code ends up going on the client's machine, so things like API keys and whatnot aren't safe in the code but it's just straightforward C# code, no javascript and almost no HTML, no magic API strings or anything, just methods with strongly typed signatures er... depending on how you deal with the API parts, cuz there are still API parts, but not with things like [Route("MagicString")] tags that you have to keep up with as a nice bonus, anything you do in blazor can also be moved straight over to MAUI (or vice versa) as a full fledged client application with pretty much no changes
studentoffuturearts
K, thanks for the info!
Want results from more Discord servers?
Add your server
More Posts
✅ I get an Issue if I lf 2 artikels. how Ican fix this?```cs double Fleisch = 4.20; double Marmelade = 2.30; double Obst = 2.10; double Multimedia = 12.00;Unable to add migration -So i am having a working ASP.NET application running .NET 8.0. At first everything runs normally butCreating 2 one-to-one relationships with a composite foreign key, EF Code FirstHello everyone, I'm trying to make a database with 2 one-to-one relationships with a composite foreiPop up exe doesn’t run on log inI have a batch login script that runs for all users in my OU. This script runs a Windows Forms app IHow Can I Pull 900K Records From My Database & Not Have The Page Slow Down When Rendering The RecordI have a project that is pulling 900K records from a database & displaying them to a view. Whenever help with shared code between 2 projectsis there a way to have shared code between 2 entirely separate .csprojs? for something like usings oSystem.Data.SQLite command executions slower if a transaction is not explicitly passedI am coping a large amount of data row by row from one table to other. If I initialize a transactionBeginner in EF Core and SQL Server in need for helpHello, I am new here but I needed some help using my project. I need to connect to a SQL Server DB uMediatR pipeline problem: One Notification to three different handlers based on notificationI'm dead stuck on a problem. I'm working on a project and instead of looping through a bunch of if sWallClimb ScriptMy script i made isn't working, i think its because the player has rigidbody so it cant move vertica