Questions tagged [asp.net-core-identity]
Use ASP.NET Core Identity to add login functionality to an ASP.NET Core application.
asp.net-core-identity
1,196
questions
1
vote
1
answer
44
views
When a new access token is generated with a refresh token, ClaimTypes.NameIdentifier returns null
In my project, after logging in, an access token and a refresh token are generated for the user with JWT. When the access token expires, a request is made again with the refresh token and a new access ...
0
votes
0
answers
22
views
How can I change default AspNetUserLogins table to MyUserLogins table in Blazor web app on .NET 8, Login with individual account?
I created a Blazor web app with authentication type = Individual Account. It automatically maps to the default ASP.NET tables. Can I change the name of these tables to make it maps with my tables in ...
0
votes
0
answers
37
views
Is it safe to move scaffolded Identity pages from Areas\Identity\Pages to main site's Pages?
I have a Razor website built with ASP.NET Core 8 and the Identity framework. I have scaffolded the Identity pages, and they seem to work fine. But I don't like their paths - "/Identity/Account/...
0
votes
1
answer
60
views
Entity Framework Core : Include not working for many-to-many relationship
I'm having trouble with .Include() not working for many-to-many relationships in Entity Framework Core. My setup works fine for one-to-many relationships, but the related entities are not being loaded ...
1
vote
1
answer
108
views
ASP.NET Core Identity ApplicationUser Foreign Key Returning NULL
I have an old ASP.NET MVC project that uses Identity/SQL Server which has worked fine for over a decade and am now attempting to begin a new version that uses ASP.NET Core.
I have extended the ...
1
vote
0
answers
41
views
ASP.NET Core 5 Identity reset password token is randomly invalid
Using IdentityServer4 + ASP.NET Core Identity with .NET 5.
Our password reset endpoint throws errors, however, if I re-send the request a few times (the exact same request), it works again.
Here's a ...
0
votes
0
answers
37
views
How to add identity in ASP.NET Core using database-first approach
I am building the project in which I created the database tables in SQL Server and then I scaffolded the database, and the DbContext is created after scaffolding.
Now I want to add identity tables ...
1
vote
0
answers
40
views
How to implement two-factor authentication in SPA application with ASP.NET Core 8.0 identity as backend
I'm trying to use all the new features in ASP.NET Core 8.
I'm using this code
using IspH2H.Engine;
using IspH2H.Engine.Entities;
using IspH2H.WebAPI.Security;
using Microsoft.AspNetCore.Authentication....
0
votes
1
answer
66
views
ASP.NET Core JWT and Identity - Program.cs configuration
I am developing an ASP.NET Core 8.0 project. I use Onion architecture in my project. I use both JWT and Identity as security. When I generate tokens on the API side and send a request from postman, I ...
0
votes
0
answers
24
views
ASP.NET Core 8.0 Identity claim reverts after calling RemoveClaim
When I try to remove an ASP.NET Core 8.0 identity claim (for a different user than is currently signed in), the claim seems to be removed, but then it reverts back to the original value.
The setClaim ...
1
vote
1
answer
39
views
ASP.NET Core - adding roles to identity causes build error
I'm trying to read app roles from the IdentityUser in an ASP.NET Core application.
Per Microsoft's Documentation I've added this to my program.cs:
builder.Services.AddDefaultIdentity<IdentityUser&...
0
votes
1
answer
51
views
.NET Core userManager failing CreateAsync on an apostrophe
I seem to be failing on the CreateAsync call for the UserManager in my ASP.NET Core 7 Web API controller.
var user = new AppUser
{
DisplayName = "Bob O'Donnell",
...
0
votes
1
answer
44
views
How to redirect unauthenticated users to another website?
I am implementing some kind of SSO using cookie sharing in an ASP.NET Core MVC application. I want unauthenticated users in my app website (e.g. app.company.com) get redirected to my SSO website in ...
0
votes
1
answer
59
views
How can I implement role-based authorization in a React & ASP.NET Core project? [closed]
I used ASP.NET Core Identity in my project.
Project repository :
https://github.com/hmahdavi921/ReactTypeScriptApp1
Programs.cs file :
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore....
0
votes
1
answer
85
views
How to remove registration completely in ASP.NET Core 8.0 with Entity Framework Core?
I am building an application in which only admin can add student or teacher. I don't want anyone to register as a student or teacher. I am using ASP.NET Core 8.0 along with Entity Framework Core.
I ...