Pesqoo
Pesqoo
CC#
Created by Pesqoo on 5/22/2024 in #help
✅ Identity without ApiEndpoints
Hello, is it possible to use Identity without the services.AddIdentityApiEndpoints? Right now I use
services.AddIdentityApiEndpoints<User>()
.AddEntityFrameworkStores<RecipeDbContext>();
services.AddIdentityApiEndpoints<User>()
.AddEntityFrameworkStores<RecipeDbContext>();
but if i use it like this to not use the endpoints
services.AddIdentity<User, IdentityRoles>()
.AddEntityFrameworkStores<RecipeDbContext>();
services.AddIdentity<User, IdentityRoles>()
.AddEntityFrameworkStores<RecipeDbContext>();
I get an error that the service IEmailSender cannot be found. But I do not even want to send emails?!
4 replies
CC#
Created by Pesqoo on 5/17/2024 in #help
ASP .NET Session Auth
Hey guys, I do currently have an ASP WebAPI using Cookie Auth with
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(options =>
// ...
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(options =>
// ...
This is not using sessions right? Since I can copy the cookie value, then call the logout endpoint which calls SignOutAsync, add the cookie again and still be authenticated. But I want to use sessions, how can i make it that the frontend gets one cookie which stores the sessionId and is then authenticated with that sessionId? I have read about .AddSession but I am confused, do I still need .AddAuthentication(...).AddCookie then? I didn't find anything related to auth with a session cookie, just ressources about either cookie auth or just sessions. I do not want to use Identity since the User table already exists and my frontend is a separate react app.
1 replies