Questions tagged [asp.net-identity-2]

The second release of the ASP.NET Identity system which was designed to replace the previous ASP.NET Membership and Simple Membership systems. Use this tag if your question deals specifically to ASP.NET Identity 2 features. The [asp.net-identity] tag should be used if your question is not specific to ASP.NET Identity 2.

Resources:

Announcing RTM of ASP.NET Identity 2.0.0

1063 questions
20
votes
3 answers

Custom ASP.NET Identity 2.0 UserStore - Is implementing all interfaces required?

I've created a custom IUserStore for my application. I've implemented the interfaces I need, IUserStore, IUserRoleStore, IUserLockoutStore, IUserPasswordStore but when I…
Stephen Collins
  • 3,523
  • 8
  • 40
  • 61
19
votes
1 answer

ASP.NET Identity - custom UserManager, UserStore

I am a bit confused with customizing UserManager and UserStore. Out of the box solution comes with EF implementation and i don't want to use EF but my own DAL that uses MSSQL. I want to have Claims based security where one of the users Claims will…
dee zg
  • 13,793
  • 10
  • 42
  • 82
19
votes
2 answers

What exactly does Owin rememberBrowser do?

In several places in a standard ASP.Net MVC Identity 2.0 Owin implementation you'll see rememberBrowser, like: await signInManager.SignInAsync(user, isPersistent: isPersistent, rememberBrowser: false); If you do set rememberBrowser to true, I've…
Chris Moschini
  • 36,764
  • 19
  • 160
  • 190
19
votes
6 answers

UserManager VerifyUserTokenAsync Always False

I'm generating a usertoken like so public async Task GenerateCode() { var code = await UserManager.GenerateUserTokenAsync("heymega", new Guid("16139fcd-7ae0-449c-ad1c-f568bbe46744")); } I then pass the same token into another action via a…
heymega
  • 9,215
  • 8
  • 42
  • 61
18
votes
5 answers

aspnet identity invalid token on confirmation email

I'm trying to confirm an account but I'm getting "invalid token." error. Here's what I'm trying: var code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id); var callbackUrl = Url.Action("ConfirmacaoEmail", "Usuario", new { userId =…
Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90
17
votes
3 answers

Creating users with no password using ASP.NET Identity

I have been given the requirement to provide the ability to create users through the UI with no password. I am trying to accomplish this using ASP.NET Identity. I am able to successfully create a user without a password using the UserManager's…
Sam Parsons
  • 537
  • 1
  • 6
  • 17
17
votes
2 answers

ApplicationUserManager.Create called on every request

I'm using asp.net mvc 5 with external provider owin provide (facebook, twitter) ApplicationUserManager.Create is called on every request. There is a lot of unnecessary stuff for logged in user in there (password validator configuration or sms and…
MDu
  • 201
  • 2
  • 6
17
votes
3 answers

Cannot login on ASP.NET Identity 2 site after programmatic user creation

I have a new MVC 5 razor, EF 6 web application using ASP.NET Identity 2 for the membership system. When I create the users manually using the Register link on the web page, it goes fine. I can create the user, I can then login with the given…
Lord of Scripts
  • 3,579
  • 5
  • 41
  • 62
17
votes
2 answers

Add user First Name and Last Name to an ASP.NET Identity 2?

I changed over to use the new ASP.NET Identity 2. I'm actually using the Microsoft ASP.NET Identity Samples 2.0.0-beta2. Can anyone tell me where and how I can modify the code so that it stores a user First and Last name along with the user…
user1943020
16
votes
2 answers

How to get role name for user in Asp.Net Identity

I am trying to figure out how to find user role name in identity framework. I have such configuration that there will be only one role assigned to a user. So, I tried using public string GetUserRole(string EmailID, string Password) { var user =…
SadikAli
  • 594
  • 1
  • 4
  • 21
16
votes
2 answers

Creating Asp.net Identity user in Seed method of Db Initializer

I have created my data layer with EF 6 code first and I am populating the db through Seed method of EvInitializer class inheriting from DropCreateDatabaseIfModelChanges. The implementation of Seed method is protected override void Seed(EvContext…
16
votes
1 answer

ASP.NET Identity 2.0 implementation without Entity Framework

Is there a custom implementation for ASP.NET Identity 2.0 that does not use Entity Framework? I'm hoping for something that does not use a full blown ORM but something along the lines of Dapper. The reason I'm asking is because I am not using Entity…
Ryan Rodemoyer
  • 5,548
  • 12
  • 44
  • 54
15
votes
2 answers

Usage of User.IsInRole() in a View

In my mvc5 project to disable an action link for unauthorized users i did like this @if (User.IsInRole("Admin") | User.IsInRole("Manager")) { @Html.ActionLink("Add New Record", "ProductTypeIndex", "ProductType") } But if there are many…
Isuru
  • 950
  • 1
  • 13
  • 34
15
votes
1 answer

ASP.NET Identity: Update external claims after authorization

I am using ASP.NET Identity with several external login providers and I need to handle the following scenario: 1) A user logs in using an external service (let's say it is Facebook), application grabs some info from Facebook (first and last name,…
nativehr
  • 1,131
  • 6
  • 16
15
votes
4 answers

Seed database for Identity 2

I came across a problem for seeding the database with Identity v2. I separated out the IdentityModel from the MVC5 project to my Data Access Layer where I setup EF Migrations as well. So I commented out the code which use inside "IdentityConfig.cs"…
Ammar Khan
  • 2,565
  • 6
  • 35
  • 60
1 2
3
70 71