Answer Overflow Logo
Change Theme
Search Answer Overflow
GitHub
Add Your Server
Login
Home
Popular
Topics
Gaming
Programming
Arch Leaders
Posts
Comments
C
C#
•
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
C
C#
•
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
C
C#
•
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