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

1064 questions
132
votes
6 answers

How to extend available properties of User.Identity

I'm using MVC5 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 class…
RobHurd
  • 1,931
  • 7
  • 25
  • 29
104
votes
10 answers

No IUserTokenProvider is registered

I recently updated Asp.Net Identity Core of my application form 1.0 to 2.0. There are new features which I wanted to try like GenerateEmailConfirmationToken, etc. I'm using this project as a reference. When the user tries to register, I get error…
Cybercop
  • 7,905
  • 19
  • 65
  • 125
74
votes
21 answers

Asp.NET Identity 2 giving "Invalid Token" error

I'm using Asp.Net-Identity-2 and I'm trying to verify email verification code using the below method. But I am getting an "Invalid Token" error message. My Application's User Manager is like this: public class AppUserManager :…
Julio Schurt
  • 1,426
  • 2
  • 12
  • 19
71
votes
11 answers

ASP.NET Identity change password

I need ability to change password for user by admin. So, admin should not enter a current password of user, he should have ability to set a new password. I look at ChangePasswordAsync method, but this method requires to enter old password. So, this…
Oleg Sh
  • 6,972
  • 9
  • 60
  • 109
62
votes
2 answers

How To Change Password Validation in ASP.Net MVC Identity 2?

How To Change Password Validation in ASP.Net MVC5 Identity 2 ? Thanks
Nazmul Hossain
  • 1,965
  • 5
  • 21
  • 33
50
votes
1 answer

UseOAuthBearerTokens vs UseOAuthBearerAuthentication

In our Startup class, I have configured the following auth server options: OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions() { AllowInsecureHttp = true, TokenEndpointPath = new…
Dave New
  • 34,265
  • 48
  • 183
  • 366
46
votes
6 answers

Why new fb api 2.4 returns null email on MVC 5 with Identity and oauth 2?

Everything used to work perfect until fb upgraded it's api to 2.4 (I had 2.3 in my previous project). Today when I add a new application on fb developers I get it with api 2.4. The problem: Now I get null email from fb (loginInfo.email = null). Of…
Dudi
  • 2,913
  • 1
  • 24
  • 22
36
votes
3 answers

ASP.Net MVC 5 w/identity 2.2.0 Log off not working

I am using a the basic login on a test ASP.Net MVC 5 site (for an internet site). The login works fine but when I try to logout it doesn't happen. The logout link does call the following controller action: public ActionResult LogOff() { …
John S
  • 7,213
  • 17
  • 65
  • 125
32
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…
31
votes
5 answers

Accessing UserManager outside AccountController

I am trying to set the value of a column in aspnetuser table from a different controller (not accountcontroller). I have been trying to access UserManager but I can't figure our how to do it. So far I have tried the following in the controller I…
30
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,610
  • 14
  • 53
  • 81
30
votes
4 answers

ASP.NET 5 Identity - custom SignInManager

I have a MVC 6 project (vNext) and I am playing around with the ASP.NET Identity. In my case I don't want to use the build-in stuff which uses the EF (SignInManager, UserManager, UserStore). I have an external database and I just want to make a…
30
votes
5 answers

Asp.Net Identity save user without email

I want to save user without email, like this: var user = new ApplicationUser { UserName = model.Name }; var result = await UserManager.CreateAsync(user); But I got error "Email cannot be null or empty". Is there any solution for this? Or it is…
Hagakurje
  • 772
  • 2
  • 9
  • 16
29
votes
3 answers

Identity 2.0 with custom tables

I'm new to ASP.NET identity and am still trying to get my head around how it all works. Unfortunately I've found many of the tutorials I've tried are for Identity 1.0, whereas I'm attempting to work with Identity 2.0. The biggest problem I am facing…
joshhendo
  • 1,876
  • 1
  • 21
  • 27
28
votes
1 answer

How can I implement Claims-Based Authorization with ASP.NET WebAPI without using Roles?

I have an ASP.Net WebAPI 2 Application that uses Claims. The claims are stored as two additional columns in a standard Identity2 AspNetUsers table: CREATE TABLE [dbo].[AspNetUsers] ( [Id] INT IDENTITY (1, 1) NOT…
1
2 3
70 71