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
37
votes
1 answer

Why do ASP.NET Identity logins from one site get shared with different websites on the same machine?

I create a brand new web application say "WebApplication1" - WebForms with Authentication set to Individual User Account. I don't add a single line of code to the auto generated code template. I run the application and register a user "User1" and…
mac-geek
  • 463
  • 1
  • 5
  • 7
36
votes
3 answers

ASP.Net Core Identity login status lost after deploy

I am using ASP.Net Core and MS Identity, I try to understand why after each deployment the login users are logged out. I am running on a IIS 8.5 I have been trying the method in this thread (setting static machine key) ASP.NET Identity 2 relogin…
Jean
  • 4,911
  • 3
  • 29
  • 50
36
votes
1 answer

How to add ASP.NET MVC5 Identity Authentication to existing database

I am learning MVC5 identity authentication and was reading materials on www.asp.net. I have a few questions here. If I want to use identity authentication, is there a reason not to use MVC template? Or is there a reason to use empty template? MVC…
sfdcnoob
  • 777
  • 2
  • 8
  • 19
36
votes
4 answers

ASP.NET MVC 5 how to delete a user and its related data in Identity 2.0

I'm following this article to delete a user in Identity 2.0 http://www.asp.net/mvc/tutorials/mvc-5/introduction/examining-the-details-and-delete-methods However, I need to delete all related records in AspNetUserRoles first and then delete the…
Franva
  • 6,565
  • 23
  • 79
  • 144
36
votes
6 answers

How to create a user and get the newly created ID with ASP.NET Identity

I am new to the ASP.NET Identity framework and am trying to do some things that I used to do in the older FormsAuthentication framework. What I want to do is allow an administrative user to create a new user using the existing Register view (or…
FrankO
  • 2,522
  • 6
  • 24
  • 34
36
votes
3 answers

Asp.net Identity password hashing

The new ASP.net Identity project has brought some useful code and interfaces for website security. To implement a custom system using the interfaces (instead of using the standard Entity Framework implementation included in the MVC 5 template) an…
Edward Wilson
  • 456
  • 1
  • 5
  • 8
35
votes
1 answer

What is the Signing Credential in IdentityServer4?

We are in the process of implementing Identity Server 4 with our .NET Core web app. I went trough the Identity Server documentation. When configuring the Identity server (using DI) there is the line: .AddTemporarySigningCredential I'm trying to…
35
votes
4 answers

Identity Provider and Unity Dependency Injection

I have downloaded this sample in which I can try the features of Identity Provider in ASP.NET MVC 5: http://www.nuget.org/packages/Microsoft.AspNet.Identity.Samples I have used many times Unity DI for my repositories, services, unit of work and…
chemitaxis
  • 13,889
  • 17
  • 74
  • 125
35
votes
4 answers

Prevent login when EmailConfirmed is false

The newest ASP.NET identity bits (2.0 beta) include the foundation for confirming user email addresses. The NuGet package "Microsoft Asp.Net Identity Samples" contains a sample showing this flow. But in that sample, even when EmailConfirmed = false,…
BenjiFB
  • 4,545
  • 10
  • 46
  • 53
35
votes
4 answers

Why is Asp.Net Identity IdentityDbContext a Black-Box?

There is a lot of confusion it seems around IdentityDbContext. If we create two Database Contexts in our application, one for Identity and one for our custom business data, the Identity Database Context inherits from IdentityDbContext while our…
Sean Newcome
  • 1,497
  • 2
  • 17
  • 24
34
votes
3 answers

NormalizedUserName VS Username in DotNet Core

I'm trying to create a custom implementation of IUserLoginStore for MongoDB and I noticed when using UserManager with the method var userResult = await _userManager.CreateAsync(user); it goes through the implementation of…
pedrommuller
  • 15,741
  • 10
  • 76
  • 126
34
votes
3 answers

Using async / await inside .Select lambda

I am using Asp.Net Core Identity and trying to simplify some code that projects a list of users and their roles to a ViewModel. This code works, but in trying to simplify it I have gone into a crazy spiral of errors and curiosity. Here is my…
FranksBrain
  • 757
  • 1
  • 8
  • 11
34
votes
3 answers

How to make EF-Core use a Guid instead of String for its ID/Primary key

When I look at the ASP.NET 3 Identity it uses a string and not a Guid for the unique primary key. In my Entity Framework code first Users' ApplicationUser class I inherit the Identity class public class ApplicationUser : IdentityUser { } which…
34
votes
4 answers

How to protect all controllers by default with bearer token in ASP.NET Core?

I have added a JWT middleware to my application: app.UseJwtBearerAuthentication(options => { options.AutomaticAuthenticate = true;} ) Ideally what I want to achieve is that all controller actions are protected by default (there were filters for…
Ilya Chernomordik
  • 27,817
  • 27
  • 121
  • 207
34
votes
4 answers

How to create ASP.Net Identity tables inside existing database?

I am building my first MVC 5 / Entity Framework application. I used the database first method to pull in my data from an existing SQL server. The existing SQL database receives it's data from a separate web forms .net application. Moving…