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

Moving ApplicationUser and other models out of MVC project

How can I split the properties, functionality and classes out of the default ASP.Net Mvc / Identity 2.0? I am battling with a few things: by default, it wants to use OWIN's context to wire up some kind of dependency injection, and control the…
AndrewP
  • 1,598
  • 13
  • 24
9
votes
1 answer

IdentityServer 3 + Asp.net Identity: Scopes, Claims and Clients - Clarifications

I'm almost figuring out how the different pieces of an Authentication and Authorization server architecture work. I really think that IdentityServer is a great piece of software. I'm trying to summarize my discoveries, to settle a base for my…
Marconline
  • 1,108
  • 12
  • 30
9
votes
2 answers

HttpContext.Current is null inside Identity Framework's methods

I am using ASP.NET MVC 5 and Identity Framework. When I call UserManager.UpdateAsync(...) my eventhandlers on ApplicationDbContext() SaveChanges will run. Here I am using HttpContext.Current for different purposes (logging and auditing) so I must…
g.pickardou
  • 32,346
  • 36
  • 123
  • 268
9
votes
3 answers

Implementing UserManager to use a custom class and Stored Procedures

All of the authentication and authorization process of my app is done using stored procedures. I've written a class with all of functionalities that I need, e.g. GetUsers, Login, AddRole, AddMember, etc. Also the admin page for managing users and…
Akbari
  • 2,369
  • 7
  • 45
  • 85
9
votes
2 answers

Using MVC 5's identity, can't get user name right after logging in

I'm trying to use the MVC 5's identity solution, but got stuck on something that should be very simple: I want the login method on the AccountController to get the loged user's name right after validating the model (and I don't want to use it from…
Marcelo Myara
  • 2,841
  • 2
  • 27
  • 36
9
votes
4 answers

Example of using asp.net 5 MVC 6 with Identity and EF 6

I'm setting up a new project using asp.net 5 and MVC 6, but I want to use Entity Framework 6 due to the missing features in EF 7. I setup EF 6.1.3 and that is working. Identity 3.0 depends on EF 7 so I have removed that and referenced in Identity…
Tom
  • 836
  • 7
  • 14
9
votes
1 answer

What is GenerateEmailConfirmationToken() doing exactly?

I have two questions concerning ASP.Identity 2.0 "GenerateEmailConfirmationToken/GenerateEmailConfirmationTokenAsync" methods. // Generate token var token = Url.Encode(await UserManager.GenerateEmailConfirmationTokenAsync(user.Id)); Is this token…
Ingmar
  • 1,525
  • 6
  • 34
  • 51
9
votes
1 answer

How to show captcha after N failed login attempts?

I have an ASP.NET MVC 5 application that uses ASP.NET Identity 2.0 for user authentication. Currently, users are forced to enter captcha on every login attempt, but it causes many complains about authentication complexity. The main goal is to make…
sigurd
  • 3,071
  • 4
  • 29
  • 37
9
votes
2 answers

MVC 5 - Add a claim to a user

I am developing a MVC 5 internet application and am using Identity 2.1. How can I add a claim to a user, after the user has logged in, where I knows the username? Here is what I have: public void AddClaimToUser(string userName, string type, string…
Simon
  • 7,991
  • 21
  • 83
  • 163
9
votes
3 answers

UserManager Keeps throwing a System.ArgumentNullException

I am trying to implemented the standard Id in AspNetUsers from nvarchar to int. I've manage to get that side working. However my issue is when I try to login I keep getting an error from the UserManager class. My code is below: public class…
Izzy
  • 6,740
  • 7
  • 40
  • 84
9
votes
2 answers

Can send emails through Gmail account only if account has "Access for less secure apps" enabled

If my Gmail account has Access for less secure apps disabled, then my application can't send emails through this account. Instead I get "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1…
bckpwrld
  • 1,159
  • 1
  • 11
  • 23
9
votes
2 answers

Trying to change table names in ASP.NET Identity 2.0

I want to change the names of the tables used by ASP.NET Identity 2.0. I've seen various similar questions but nothing that solves my problem. For instance this type of…
see sharper
  • 11,505
  • 8
  • 46
  • 65
9
votes
2 answers

exception after upgrade ASP.NET Identity to 2.0

my project: VS2013, Entity Framework, Web forms, database first, Identity I updated all NuGet packages of my project today (2014-4-15). Among them, Identity is upgraded to 2.0.0.0. I thought things were going good, but unfortunately when I run the…
martial
  • 3,773
  • 8
  • 33
  • 43
8
votes
1 answer

ASP.NET Identity verify if ResetPassword token has expired

In my API I have 2 endpoints, first that generates email to reset password form (I generate token using UserManager.GeneratePasswordResetTokenAsync). Second endpoint is for actual password reset (I use UserManager.ResetPasswordAsync). My requirement…
Misiu
  • 4,738
  • 21
  • 94
  • 198
8
votes
1 answer

Check if user is still logged in without resetting auth timeout

I have an ASP.Net MVC 5 application, using Identity 2 for authentication (using the standard cookie authentication middleware, configured with ExpireTimeSpan = 30 minutes and SlidingExpiration = true). I have configured authentication to expire…
Najkin
  • 932
  • 1
  • 7
  • 16