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
43
votes
4 answers

Add role in ASP.NET Identity

How can I add a Role in the new ASP.NET Identity system (1.0)? There is a UserStore class but no RoleStore class. I can't find any documentation on this issue.
daniel
  • 34,281
  • 39
  • 104
  • 158
42
votes
2 answers

What is the use of Normalized Email & UserName in .NET core IdentityUser Model?

When I use IdentityUser model in Asp.Net Identity with EntityFramework, it creates some standard fields in the database. All the fields are self explanatory except for the below two fields. NormalizedUsername - Which contains the uppercase value of…
Faraj Farook
  • 14,385
  • 16
  • 71
  • 97
42
votes
4 answers

The entity type 'Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin' requires a key to be defined

I have a ASP.NET5 MVC application using EF7. It works all fine so far and i'm able to add migrations and persist data in the database. Now after adding Identity to my data layer project I get this error when trying to add a new migration: The…
Olaf D.
  • 537
  • 1
  • 6
  • 13
42
votes
2 answers

How do I use ASP.NET Identity 2.0 to allow a user to impersonate another user?

I'm migrating a ASP.NET MVC 5.1 application from MembershipProvider to ASP.NET Identity v2.0. One of the features I have in the application is user impersonation: Administrators can be logged in as any other user registered on the site without…
trailmax
  • 34,305
  • 22
  • 140
  • 234
42
votes
7 answers

MVC5 (VS2012) Identity CreateIdentityAsync - Value cannot be null

I am trying to setup OAuth for a an MVC5 site (in VS2012). I am using Fluent NHibernate. I have setup my own Userstore and pass in a repository object to access NHibernate session object. I pass my store into the default aspnet usermanager…
Jon
  • 15,110
  • 28
  • 92
  • 132
40
votes
11 answers

"Trust relationship between ... and the primary domain failed" in MVC5 Authentication

I have a ASP .NET MVC5 application in which I am not using Windows Authentication. Everything was working fine until I tried running the application outside of the Domain in which it was being developed and (for whatever reason) got a: The trust…
user1987392
  • 3,921
  • 4
  • 34
  • 59
40
votes
4 answers

ASP.NET Identity, require 'strong' passwords

Perhaps my googlin' skills are not so great this morning, but I can't seem to find how to set up different password requirements (rather than min/max length) with a new asp.net mvc5 project using individual user…
ledgeJumper
  • 3,560
  • 14
  • 45
  • 92
39
votes
3 answers

How to extend IdentityUser with custom property

I'm using asp.net Identity 2.0 for users to log into my website, where the authentication details are stored in an SQL database. Asp.net Identity has been implemented in a standard way as can be found in many online tutorials. The ApplicationUser…
user3378165
  • 6,546
  • 17
  • 62
  • 101
39
votes
3 answers

What is the difference in the use of UserStore and UserManager in ASP.NET Identity?

I'm very new to ASP.NET Identity and please bear with me if this question seems silly. When I read the definition for the UserStore and the UserManager classes on the Microsoft website which are in the links below, it looks like both classes define…
MinhNguyen
  • 816
  • 1
  • 11
  • 26
39
votes
3 answers

Using Windows Domain accounts AND application-managed accounts

It's easy to create an ASP.NET MVC application that authenticates based on windows domain user. It's also easy to create one that uses individual accounts stored using Entity Framework. In fact, there are project templates for both. But I want to…
recursive
  • 83,943
  • 34
  • 151
  • 241
39
votes
5 answers

How to Construct IdentityResult With Success == true

I have a class with Microsoft.AspNet.Identity.UserManager injected, and I want to expect the userManager.CreateAsync(user, password) method to return a Task where the IdentityResult.Succeeded = true. However, the only available constructors for…
jakejgordon
  • 4,008
  • 7
  • 36
  • 45
38
votes
3 answers

ASP.NET Web API and Identity with Facebook login

In the Facebook authentication flow for ASP.NET Identity, the Facebook OAuth dialog appends a code rather than an access token to the redirect_url so that the server can exchange this code for an access token via e.g.:…
38
votes
14 answers

No owin.Environment item was found in the context

Microsoft recently introduced new ASP.NET Identity - replacement for old (Simple)Membership. Unfortunately, I can't use this new membership system in my old project because it throws System.InvalidOperationException: No owin.Environment item was…
graycrow
  • 3,675
  • 6
  • 26
  • 28
37
votes
3 answers

Store does not implement IUserRoleStore ASP.NET Core Identity

I'm using ASP.NET Core 2.1 Identity. I've overridden IdentityUser because I need to add some additional properties on the user. In…
John81
  • 3,726
  • 6
  • 38
  • 58
37
votes
4 answers

How to set asp.net Identity cookies expires time

I use Asp.Net Identity to control my app's authorization. Now, I need to do this: if the user does not operate in 30 minutes, jump to the login page, when he login does not select "isPersistent" checkbox. And, if he selected "isPersistent" checkbox,…
Ivan.Yu
  • 564
  • 1
  • 4
  • 12