Questions tagged [asp.net-identity]
The ASP.NET Identity system is designed to replace the previous ASP.NET Membership and Simple Membership systems. Use the ASP.NET Core Identity tag for questions about Identity in ASP.NET Core.
asp.net-identity
9,039 questions
0
votes
1
answer
112
views
401 Unauthorized despite sending login token in Headers
I am trying to do a POST request to an API endpoint api/auth/assign-role with this data:
...
Advice
0
votes
1
replies
64
views
How to implement session timeout in .NET Framework 4.7.2 application
We have several applications built in .NET Framework 4.7.2 that uses .NET Identity for authorisation and authentication. I am trying to implement a session timeout, in line with OWASP recommendations.
...
0
votes
1
answer
298
views
Protected Remote MCP Server - VS Code
I'm trying to connect vs code to a local MCP server that is using HTTPTransport and is secured by OAuth. It was working fine up to the point I started validating the scope.
...
0
votes
1
answer
152
views
Owin security could not handle callback "signin-oidc", Error 404 on ASP.NET MVC
I have a simple ASP.NET MVC app with .NET 4.8.
I want to use keycloak as security management and my app connect to it via openid connect protocol.
To do this, I've created a ...
0
votes
0
answers
111
views
How to modify ASP.NET Core Identity cookie name after initialization?
I have an ASP.NET Core application that does multi-tenanting based on the path. For example to log into tenant1 you would go do https://domain.name/tenant1 and to log in as tenant2 you would go do ...
1
vote
1
answer
60
views
No buttons (or other interactive elements) work when I use a data-bound object
I’m trying to display user identities and fetch a list of users, but buttons stop functioning if I use ApplicationUser (inherited from IdentityUser) retrieved via UserManager.
...
0
votes
1
answer
394
views
Blazor Server (Interactive Render Mode) Custom Login Page with IdentityCore and Cookie Authentication
I'm building a Blazor application using the interactive server rendermode and I want to implement a custom login page using ASP.NET Core Identity. For authentication, I'm configuring IdentityCore like ...
0
votes
0
answers
57
views
Using JWT for Identity Auth in MongoDB
I am running into an issue with trying to use .NET Identity with a MongoDB backend. The problem is related to authorization. I want the API to use JWT but it would seem the package I am using defaults ...
0
votes
0
answers
100
views
How to reuse and extend the existing Refresh Token when using refresh_token grant in OpenIddict without issuing a new one?
I'm using OpenIddict 6.3.0 with ASP.NET Core 8, and I want to customize the behavior when using the refresh_token grant.
✅ Goal:
When a refresh_token is used:
I want to reuse the existing refresh ...
0
votes
0
answers
81
views
ASPNET IDENTITY Automatically terminates user sessions
I developed a website using .NET 6.0 and ASPNET Identity. I dont have any cookie or session related operations in my controllers. Also, everything perfectly works in my development enviroment (I mean, ...
0
votes
0
answers
42
views
Does ASP.NET Identity have a method that allows for batch creation of users using UserManager?
I am implementing a method that receives data from an API. At the moment, the API is adding the data to the database by using a loop. This however is looking more and more unreliable as the data keeps ...
1
vote
0
answers
223
views
Problems integrating MudBlazor with existing Blazor login page
I've been trying to enhance my Blazor Identity login page with MudBlazor components. I've encountered multiple errors that prevent it from working:
SSL Certificate Error - When I first added ...
0
votes
1
answer
89
views
EntityFrameworkCore.Identity: Can it be added to an existing project or should I start from scratch?
I'm working on my final year project(fyp) and intended to add an account system using EF Core Identity. When I started my project I found it difficult to get to grasps with the best way to use ...
0
votes
0
answers
85
views
OpenIdDict using PKCS#11 / HSM interface?
I am working on a project that uses OpenIdDict für user authentication, thus, generating and validating JWTs (Java web tokens, HTTP header "Bearer").
Currently, the prototype relies on a ...
0
votes
0
answers
95
views
How to extend Client entity in Duende Identity Server v 7
I'm using Duende Identity Server v 7.0.7 and I need to add custom property to Client model. So basically add column to "Clients" table to store client specific value.
I know it is possible ...
0
votes
0
answers
57
views
System.MissingMethodException with AspNetCore.Identity.MongoDbCore and MongoDB.Bson.BsonDefaults
I'm attempting to integrate AspNetCore.Identity.MongoDbCore into my application. However, upon running the application, I encounter the following error:
System....
1
vote
0
answers
50
views
ASP.NET Identity reset password issue "username already taken"
I'm trying to reset user's passwords and I keep getting "username already taken" as an error. I don't quite understand... I'm not trying to create a new user, I'm trying to reset an existing ...
0
votes
1
answer
48
views
Identity Model Customization .NET Core 8
I am trying to access the UserRoles property from my ApplicationUser entity and I keep getting an error message stating ...
-1
votes
1
answer
65
views
Unable to create a 'DbContext' of type 'IdentityContext'. The exception
I wanted to create a many to many connection between the identity user and another table
but when i modified my identity context and wanted to create a migration i got the following error
Unable to ...
0
votes
0
answers
110
views
How can I specify WithAppOnly() globally for a GraphServiceClient, so I don't have to specify it for every single Microsoft Graph request?
How can I specify WithAppOnly() globally for a GraphServiceClient, so I don't have to specify it for every single Microsoft Graph request?
Consider the following code:
...
0
votes
0
answers
32
views
Validate Google Auth Token against Microsoft Identity External Authentication
I have an ASP.NET MVC web application using Microsoft Identity authentication with Google Authentication features, all works great from the website.
The web site also exposes APIs for clients apps (a ...
0
votes
0
answers
72
views
Can I use an interface with a foreign key in EF 6 and set it as a foreign key
I'm using EF 6 with .NET 4.8.
All data entities classes are defined in a Model project so it can be used by client apps. Only ...
0
votes
2
answers
90
views
The foreign key property 'UserRole.UserId1' was created in shadow state
EF creates UserId1 and RoleId1 in UserRoles table when I try to add migration.
there are messages:
The foreign key property 'UserRole.RoleId1' was created in shadow state because a conflicting ...
0
votes
2
answers
136
views
Google login in ASP.NET Core - user still unauthorized with Google bearer token
I have integrated Google login with my ASP.NET app.
So in callback call from google auth I get code that I use to get user token:
...
1
vote
1
answer
482
views
Trying to seed data using Identity.AspNetCore with .UseSeeding and .UseAsyncSeeding?
So I've ran into an issue that I am not sure how to handle.
You see I am trying to deal with an Initial seeding of Admin data for my App.
But the thing is.. Since I am using Identity to handle both ...
0
votes
0
answers
113
views
Issues with ASPNET Identity Google behind NGINX based reverse proxy
I'm in the process of adding Google Authentication to .NET 8 web app behind NGINX reverse proxy.
App itself is simple CRUD web app. I do have Let's Encrypt certificate for https, it is terminating on ...
0
votes
3
answers
187
views
How can a user's selected authentication method be retrieved?
I want to retrieve the authentication method of a logged-in user, e.g. something like "by username/password", or for oauth cases "via facebook" or "via google".
After ...
0
votes
0
answers
43
views
Register Multiple Connection strings & client ids in .NET 6 Identity Server
I have a default connection string which has the default connection for the identity server so I register this identity server successfully, but I have tenants stored in a database table and I have a ...
0
votes
1
answer
94
views
Method userManager.FindByEmailAsync() returns object with empty UserName and Email
I had to extend IdentityUser model (and AspNetUser table of course) with some extra field (RegistrationDate) so I created ...
-13
votes
1
answer
325
views
Get email, phone, etc from OAuth2 login [closed]
I am working on adding the ability to authenticate in my app using Google OAuth2. My app is a Blazor Interactive Server using the Identity Library (not Blazor Identity). I don't have this working yet. ...
0
votes
1
answer
88
views
How to configure a Razor Pages project to use Identity endpoints in a WebApi project using cookie authentication
I have a WebApi project that has endpoints for all the business logic, including an implementation of the Identity endpoints for login/register/etc.
The cookie authentication works fine on the WebApi ...
0
votes
2
answers
204
views
Auto Login in NET 8 Blazor project with .NET Identity authentication
I am working on a .NET 8 Blazor project with .NET Identity authentication. My goal is to automatically log in the user and redirect them within the OnInitializedAsync method based on an OTP provided ...
1
vote
0
answers
45
views
ASP.NET Identity: Custom RefreshTokens vs Built-in AspNetUserToken
I'm currently implementing token-based auth with refresh tokens in my .NET app. Right now I have a custom RefreshTokens collection in my ApplicationUser:
...
0
votes
0
answers
165
views
How to set Content Security policy of Identity Server Connect/Authorize function internal call?
I am facing a issue when Identity server redirect from https:/sso.com/connect/authorize?.. to https://anotherhost.com/sigin-oidc ...
1
vote
1
answer
558
views
How to make ASP.NET Core JWT Bearer Authentication check the Authorization header first before checking the Cookies?
To give you some context:
I am trying to implement a Refresh/Access Token Authentication security to a simple Web API using ASPNET Core. Its going well so far.. It does work! Just not as expected.
To ...
1
vote
1
answer
197
views
.NET MAUI Browser Delegated Authentication redirect URL invalid
Followed the instructions here for browser-delegated authentication, steps completed under .NET MAUI including "Prepare tenant", "Create .NET MAUI app", and "Sign in and sign ...
0
votes
1
answer
105
views
Azure AD App Registration unable to change "Who can consent"
I'm creating a MSAL web API using instructions here. When following the instructions for "Expose the API", I am not able to adhere to step b. (For Who Can consent, ensure the Admins and ...
0
votes
0
answers
530
views
Integrating Elsa 3.0 Server into our ASP .NET core web server with it's own existing Auth
We're looking at implementing Elsa 3.0 into our asp.net core web server that currently uses wasm as the client. It's all currently setup with if it's own identity combined with OpenID etc. Im just ...
0
votes
0
answers
57
views
0
votes
1
answer
178
views
Using ASP.Net Core Identity in parallel with OpenIdConnect OAuth2
I'm working on asp.net MVC project based on .NET 8.0. My site is using ASP.Net Core Identity for user authentication. It's working fine.
I have to connect to remote server which is using OAuth2 ...
-4
votes
1
answer
96
views
Could not load file or assembly Microsoft.Owin Version=3.0.1.0
execution of my web applications fails with following runtime error:
Could not load file or assembly 'Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its ...
0
votes
1
answer
281
views
ASP.NET Core 8.0 Razor Pages and Progressive Web-App (Add to home screen on mobile) does not work properly (with ASP.NET Identity; Antiforgery)
I have an ASP.NET Core Razor Pages Webpage which can be browsed to on smartphones (Android and IPhones).
I use ASP.NET Core Identity to secure access to the site.
My users want to add icons to the ...
0
votes
1
answer
98
views
Using ASP.Net Core Identity for Razor page web app and MAUI app
I've got a razor pages/mvc web app that uses ASP.Net Core Identity for authentication and authorization. I'm starting to develop a mobile app version of the site using MAUI and wanting to access many ...
2
votes
1
answer
345
views
How do I get my ASP.NET Core minimal API to return a 401 if the user is not authenticated instead of redirecting to the log-in page
I have an ASP.NET Core Blazor web app, which uses Identity for authentication. The server project's Program.cs contains the following (rather trivial) endpoint...
<...
0
votes
1
answer
50
views
How to remove the User Name Field from the identity user in asp.net core 8
I want to remove the UserName field from the IdentityUser
I don't want to use it
1
vote
1
answer
138
views
Implementing External Login does not set IsAuthenticated to true unless I refresh the page
I have implementing external login in my NET Core 8 web application.
Ths is the callback method:
...
-1
votes
2
answers
118
views
How to use an identifier other than "email" for users in Firebase Authentication + OIDC
I've set up Firebase Authentication for my app with an OIDC provider. In this OIDC provider, the email address isn't required to be unique. For instance, users from the same company could share their ...
-1
votes
1
answer
31
views
Argument type is not assignable to parameter type problem in IdentityDbContext
I am currently using .Net Framework Identity
And been following a video tutorial.
...
1
vote
1
answer
32
views
CreatedAtAction for a Post request of register
I have an AuthController class with a register Post request:
...