Arch Leaders
Arch Leaders
CC#
Created by Arch Leaders on 6/28/2024 in #help
Restrict register endpoint using ASP.NET Core Identity
Hm, I'll look into it. Thanks!
14 replies
CC#
Created by Arch Leaders on 6/28/2024 in #help
Restrict register endpoint using ASP.NET Core Identity
Found an SO post that suggested just copying the extension class from MS and making my changes. I'm open to a cleaner solution though.
14 replies
CC#
Created by Arch Leaders on 6/28/2024 in #help
Restrict register endpoint using ASP.NET Core Identity
I can restrict all of them using this, however this also restricts /login which doesn't work for obvious reasons.
app.MapIdentityApi<User>()
.RequireAuthorization(x => x.RequireClaim("Admin"));
app.MapIdentityApi<User>()
.RequireAuthorization(x => x.RequireClaim("Admin"));
14 replies