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
34
votes
5 answers

Why is ASP.NET Identity 2.0 using a GUID/string as user id?

As the title says, I wonder, why ASP.NET Identity 2.0 uses a string with a GUID as primary clustered key for the user table. Does this have any advantages to an integer id? I see only the problem, that a GUID isn't the best choice for a clustered…
user2897701
34
votes
4 answers

ASP.NET Identity with Repository and Unit of Work

I'm learning Repository and Unit of Work patterns in ASP.NET MVC 5 application with Entity Framework 6. I had already read a lot of tutorials and articles, but almost all of them are condradictory. Ones say that Repository and Unit of Work patterns…
34
votes
3 answers

How does a new ASP.NET MVC 5 application know how to create a database and how does the Account Controller access the database?

I created an ASP.NET MVC 5 Application using Visual Studio 2013 Update 2. In the application, I have an Account controller. It's different from what I am used to and does not contain an instantiation of dbcontext. public class AccountController :…
user1943020
34
votes
2 answers

ASP.NET Identity vs Simple membership Pros and Cons?

In MVC4 we had Simple Membership. My opinion is that Simple Membership was a good Identity Model tried and tested with good documentation and didn't need to be fixed but simply needed an upgrade in terms of Email Verification/ Password Reset and all…
33
votes
6 answers

How to use Windows Active Directory Authentication and Identity Based Claims?

Problem We want to use Windows Active Directory to authenticate a user into the application. However, we do not want to use Active Directory groups to manage authorization of controllers/views. As far as I know, there is not an easy way to marry AD…
33
votes
8 answers

Get list of users with assigned roles in asp.net identity 2.0

I have a drop down list box which lists roles. I want to get the list of users having that role. I mean list of users that are in "Administrator" role or "CanEdit" role. Here is my code: public…
33
votes
3 answers

Email Confirmation with MVC 5 and Asp.net Identity

I have been searching, but have not found any documentation on how to implement Email confirmation with MVC 5 using the new ASP.net Identity. There does not seem to be any documentation on this topic (that I could find). Has anyone solved this yet?…
John
  • 1,852
  • 4
  • 26
  • 49
32
votes
1 answer

Asp.net Core Identity Use AspNetUserClaims or AspNetRoleClaims?

I am still confused about all this Identity stuff.  First I am still confused the difference between Roles, Policies/Claims. From what I read roles is the old way of doing stuff and was kept for backward compatibility, so does that mean…
chobo2
  • 83,322
  • 195
  • 530
  • 832
31
votes
3 answers

JWT Authentication - UserManager.GetUserAsync returns null

In AuthController when authenticating I create a few Claims - UserID is one of them. ... Subject = new ClaimsIdentity(new[] { new Claim(ClaimTypes.Name, user.UserName), new Claim("UserID", user.Id.ToString()), }) When Angular app makes request…
Alex Herman
  • 2,708
  • 4
  • 32
  • 53
31
votes
4 answers

The certificate chain was issued by an authority that is not trusted

I studied the help here on upgrading to aspnetcore 2.1.0 My database is SQLExpress 2016SP1 I am able to add a migration but when I issue update-database at the Package Manager Console, I get an error A connection was successfully established with…
Kirsten
  • 15,730
  • 41
  • 179
  • 318
31
votes
5 answers

Dotnet core 2.0 authentication multiple schemas identity cookies and jwt

In dotnet core 1.1 asp, I was able to configure and use identity middleware followed by jwt middleware by doing the following: app.UseIdentity(); app.UseJwtBearerAuthentication(new JwtBearerOptions() {}); This has now changed in that we…
didiHamman
  • 798
  • 1
  • 9
  • 19
31
votes
17 answers

Unable to edit db entries using EFCore, EntityState.Modified: "Database operation expected to affect 1 row(s) but actually affected 0 row(s)."

I'm using Identity Core 1.0 with ASP.NET MVC Core 1.0 and Entity Framework Core 1.0 to create a simple user registration system with this article as a starting point, and I am trying to add user roles. I can add user roles, but I'm unable to edit…
31
votes
3 answers

Invalidate Old Session Cookie - ASP.Net Identity

An external company has done some penetration tests on the ASP.NET MVC 5 application i'm working on. An issue that they raised is described below A cookie linked with session Management is called AspNet.ApplicationCookie. When entered manually,the…
MrBliz
  • 5,830
  • 15
  • 57
  • 81
31
votes
1 answer

Use ActiveDirectory authorization with ASP.NET Identity

I'm implementing corporate website with asp.net mvc and want to use new ASP.NET Identity framework. Is it possible to integrate ActiveDirectory authorization with ASP.NET Identity? Any samples how to do it?
barbarian
  • 1,559
  • 6
  • 20
  • 26
31
votes
6 answers

How to access Facebook private information by using ASP.NET Identity (OWIN)?

I am developing a web site in ASP.NET MVC 5 (using RC1 version currently). The site will use Facebook for user authentication and for retrieving initial profile data. For the authentication system I am using the new OWIN based ASP.NET Identity…
Konamiman
  • 49,681
  • 17
  • 108
  • 138