Questions tagged [asp.net-identity]

The ASP.NET Identity system is designed to replace the previous ASP.NET Membership and Simple Membership systems.

The ASP.NET Identity system is designed to replace the previous ASP.NET Membership and Simple Membership systems. It includes profile support, OAuth integration, works with OWIN, and is included with the ASP.NET templates shipped with Visual Studio 2013.

ASP.NET Identity uses code-first Entity Framework to allow for maximum customization through class manipulation, annotation, and new fluent API.

Useful links

8860 questions
3
votes
1 answer

ASP.Net Identity with SAML Integration

We have an existing MVC app using the ASP.Net Identity Framework to store user logins/passwords/roles/etc... in a local SQL database. We would like to move the authentication portion of the identity to use a SAML IdP but still build out the…
3
votes
1 answer

Is it a good idea to manually create columns in existing AspNetUser table?

I'm using Identity 3 and I want to add some columns in AspNetUser table. I've tried to do it using EF Core Code first and it's working well but I need to do it DB first. I was wondering, if I will create the columns manually in database, then create…
3
votes
1 answer

How do you completely hide an element from a user based on their ASP.NET Identity Role?

Goal: Hide certain elements like page links from users based on their role in ASP.NET Identity. What I have tried: [Authorize(Roles = IdentityHelper.Administrator)] (This does restrict access to certain elements if you put the annotation over them,…
3
votes
1 answer

Disabling auto logout when user is inactive in ASP .NET Core Identity

I tried to parse this code into IdentityHostingStartup.cs: services.ConfigureApplicationCookie(options => { options.Cookie.Name = ".AspNetCore.Identity.Application"; options.ExpireTimeSpan =…
3
votes
1 answer

Refresh token with OpenIddict returns always principal to null

Since the migration from OpenIdDict 2.x to 3.X, we are not able to use refreshtoken anymore. Our code is based on dotnet core 3.1 The processing of user/password works fine and the user receives his tokens (access, id and refresh) But as soon as we…
hugo
  • 1,829
  • 1
  • 18
  • 47
3
votes
1 answer

C# Modifying Identity or Add a Claim

Application is Blazor Server .NET Core 5.0 I am using .NET Core's Identity system and I am running into a problem. I want to have the person's first name stored with the Identity so I can call on it easily. Currently I have a class overriding the…
cobb208
  • 55
  • 1
  • 7
3
votes
2 answers

Blazor Server: Custom Login Page

I'm working on a Blazor Server project to create custom login and registration pages. The page below is a testing page for custom login. If a correct username is used, the user object is successfully obtained. However, it throws error when signing…
Ibrahim Timimi
  • 2,656
  • 5
  • 19
  • 31
3
votes
1 answer

The call is ambiguous between the following methods or properties [ Entity Framework Core ] [ OnModelCreating ]

I use EF Core, inside my dbcontext class I have overridden the onModelCreating method to configure one property in a class to be auto-increment in SQL Server. This is my DbContext class: public class AppDbContext:IdentityDbContext { …
DEV
  • 121
  • 1
  • 3
  • 12
3
votes
2 answers

ASP.Net Core 3.1 Identity - Generating Password Reset Token Issue

I am developing a site where the users will be able to click a "Forgot My Password" button to reset their passwords. Currently, once the email has been validated, the following code should generate a token to be emailed to the user: if(validUser !=…
Quasimodo
  • 103
  • 1
  • 8
3
votes
1 answer

How to request offline_access from Google using .AddOpenIdConnect() in ASP.NET Core?

I know Microsoft provides a Google-specific OIDC package (Microsoft.AspNetCore.Authentication.Google) which takes an option in .AddGoogle() to specify AccessType that can be set to offline. But can this be done using the standard ASP.NET Core OIDC…
3
votes
1 answer

Scaffold Identity in "dotnet new angular" app gives error

Trying to scaffold Identity in a new app, created with "dotnet new angular --auth Individual", immediately throws an error: "There was an error running the selected code generator: 'Package restore failed. Rolling back package changes for…
John Pankowicz
  • 4,203
  • 2
  • 29
  • 47
3
votes
1 answer

Where is login page defined in Blazor WebAssembly?

I've created .NET Core 5.0 Blazor WebAssembly hosted in ASP .NET Core. Multiple views are missing but they application works. In particular the whole login page is missing and I can't forgot password page defined. How can I override them?
Yoda
  • 17,363
  • 67
  • 204
  • 344
3
votes
2 answers

why does OpenIdConnectHandler.HandleSignOutCallbackAsync hijack any request made to the SignedOutCallbackPath

I have a DunendeSoftware Identity Server (v5.0.0-preview2.13) running under ASPNetCore 5.0 and using HttpSys as the web server (no Kestrel or IIS). I have a second website (call it protectedsite) using implicit flow to authenicate to the Identity…
3
votes
1 answer

Is there any way to make ITicketStore scoped?

I am using ITicketStore as per this article. In this DbContext is created whenever required to perform any database operations. In my code instead of creating the DbContext by using() syntax, injecting through the constructor. Everything was working…
Ravi
  • 408
  • 7
  • 22
3
votes
2 answers

How to prevent a user from logging into multiple devices and how do I end the session from the previous device?

How do I prevent a user Id from only being able to log in to one computer at a time? An example, user "Sam" logs in to his Desktop. User "Sam" also logs in from their laptop. Now I need the session on the desktop killed or what I want to happen is…
NoBody
  • 53
  • 8