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

Proper way to add claims to user account in ASP.NET MVC5 web app

I am working on an ASP.NET MVC5 web app that has the following relevant properties: Uses MVC5.1, Identity 2.0, not restricted to any legacy stuff - can use newest everything. A user belongs to at least one organization. Each organization has at…
4
votes
1 answer

SignalR and ASP.NET Identity ExpireTimeSpan

I am using ASP.NET Identity with cookie based authentication. I am setting the ExpireTimeSpan on the CookieAuthenticationOptions class to control how much time of inactivity is allowed before the user has to log in again. This all works fine, but…
DownChapel
  • 1,384
  • 1
  • 16
  • 31
4
votes
2 answers

Registering Identity Framework UserStore with Simpleinjector for AccountController

I have a situation where I want to Use custom UserStore from Identity framework . So my controller looks something like this . public AccountController() : this(new UserManager(new MyUserStore())) { } public…
4
votes
2 answers

How do i create an instance of UserManager

I am trying to learn how the new asp.net identity 2.0 works, but with little documentation I am hitting quite a few stumbling blocks. I have this code below based off of a couple of tutorials that I have read: public class CustomRole :…
user1206480
  • 1,798
  • 3
  • 28
  • 45
4
votes
1 answer

Owin still authenticates the user although the session was lost

I have an ASP.NET MVC 5 website with OWIN authentication. Each user has distinct credentials in the underlying database, which is also used to authenticate the user through a custom UserManager. I store the username/password in session state before…
Mathieu Renda
  • 14,069
  • 2
  • 35
  • 33
4
votes
1 answer

Why am I getting an IdentityRole error?

Using Identity 2.0 After registering a user, the user is created in the database, there is code in the Account controller to create an identity and sign the user in. This is when I get the error. Here is the code producing the error: var identity…
4
votes
1 answer

AspNet.Identity Custom User and Custom Role should be simple; what am I missing?

Using examples from http://www.asp.net/identity I've gotten this far. The RoleManager works flawlessly and I treat the UserManager the same. I think everything is correct, but I can't seem to new up a UserManager correctly in a controller. What is…
4
votes
3 answers

How Do I Manually Get At The Information In the .aspnet.cookies Cookie?

We have an authentication setup where we disallowed everything but bearer tokens sent in headers. However, I have a situation where I need to use a cookie instead for one Web API controller. I can see that there is already a cookie sent in the…
Colin
  • 4,025
  • 21
  • 40
4
votes
2 answers

ASP.Net Identity Check for multiple roles to get access

Is it somehow possible to get asp.net identity to require membership of 2 roles before granting access? I have 2 layers of rights in my system. First a company type that grants access to certain features, and secondly one that restricts the specific…
4
votes
2 answers

Hashing legacy salted passwords with ASP.NET Identity

I have an existing membership database where passwords are a hash of both username and a unique id. As I understand, ASP.NET Identity will take care of salting passwords for you. However, I need my old hashed passwords to work until they are…
Justin Helgerson
  • 24,900
  • 17
  • 97
  • 124
4
votes
3 answers

UserManager RemoveFromRole bug

The function (RemoveFromRole in UserManager) to remove user from role is seriously buggy! If users has many roles the function seems to remove a random role but fortunately correct user. Has anyone else experienced this?
4
votes
1 answer

aspnet identity using guid as key

I am trying to use Guid's instead of strings for my primary key and have followed the following posts: How to change type of id in Microsoft.AspNet.Identity.EntityFramework.IdentityUser and How to change type of id in…
kiwijus
  • 1,217
  • 1
  • 20
  • 40
4
votes
1 answer

Asp.Net Identity Creating role in seed method failed

I tried to add a new role in the seed method, but when i run the code, the browser keep loading and have no response. Using the debugger, it was found that the code hanged on the create method. I have no idea what's going.. Any help is appreciated…
user1439272
  • 103
  • 1
  • 1
  • 4
4
votes
1 answer

Efficient caching of Identity related entities

I'm using asp.net MVC5 and asp.net Identity v2 (from the nightly releases) but I think this question still applies to Identity V1. I have a membership system and i am linking a AspNetUser entity to my membershipuser entity via a field AspUserId in…
Tim
  • 7,401
  • 13
  • 61
  • 102
4
votes
2 answers

Removing `AspNetUserLogins` table from ASP.NET Identity

As I won't be using any other login providers, I have no need for the AspNetUserLogins table. Is there any way I can remove it? I've tried this: protected override void OnModelCreating(DbModelBuilder modelBuilder) { …
Jonathan
  • 13,947
  • 17
  • 94
  • 123