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
13
votes
2 answers

Persisting claims across requests

var user = UserManager.Find(...); ClaimsIdentity identity = UserManager.CreateIdentity( user, DefaultAuthenticationTypes.ApplicationCookie ); var claim1 = new Claim( ClaimType = ClaimTypes.Country, ClaimValue = "Arctica",…
bckpwrld
  • 1,159
  • 1
  • 11
  • 23
13
votes
1 answer

How do you generate a Bearer token to call a remote Web API

I have two sites, a site that users login to and manage their account and site that has no UI and is nothing more than a API to store and retrieve content. Both of these sites use the same Owin ASP.Net Identity 2.0 setup. The UI site uses cookies…
John C
  • 1,761
  • 2
  • 20
  • 30
13
votes
1 answer

How to get ApplicationDbContext out of the Owin pipeline

This has to be simple, but I'm going bug-eyed trying to find the answer. How does a controller action get a reference to the per-request ApplicationDbContext that was stashed in the Owin pipeline? EDIT: Ok, I think I'm getting closer... or maybe…
Bob.at.Indigo.Health
  • 11,023
  • 13
  • 64
  • 111
13
votes
6 answers

Identity 2.0 Invalid Login Attempt

For some reason I am yet to discover, but after a successful registration and activation, I cannot login with the email address, instead I get an error "Invalid login attempt". As ASP.NET Identity 2.0 has improved with the use of Email login, I have…
iggyweb
  • 2,373
  • 12
  • 47
  • 77
12
votes
1 answer

Basic Authentication Middleware with OWIN and ASP.NET WEB API

I created an ASP.NET WEB API 2.2 project. I used the Windows Identity Foundation based template for individual accounts available in visual studio see it here. The web client (written in angularJS) uses OAUTH implementation with web browser cookies…
12
votes
2 answers

How to define different user types in ASP.NET Identity?

In my application I am using ASP.NET Identity and I have different types of user( Teacher, Student, ...) that have their own properties, For for Teacher I have Experience, Languages Spoken, Certifications, Awards, Affiliations, ... and for Student I…
Sirwan Afifi
  • 10,654
  • 14
  • 63
  • 110
12
votes
1 answer

MVC/Code First: how to add more tables to the same db context?

I am using the standard MVC template that comes with VS 2013. It has a neat membership provider that makes using external logins (Google, Facebook etc) a breeze. There are also tutorials on how to extend the IdentityUser model to add new…
12
votes
5 answers

How to list users with role names in ASP.NET MVC 5

I have default project template of ASP.NET MVC 5 web site and I am trying to list all users with role names (not IDs). The query is: db.Users.Include(u => u.Roles).ToList() Then I want to print the role names with something like: @string.Join(", ",…
NightElfik
  • 4,328
  • 5
  • 27
  • 34
12
votes
2 answers

What algorithm Asp.net Identity uses to encrypt the password?

What kind of algorithm does Asp.Net Identity framework use to encrypt the password? I have a scenario where android, iPhone, web and desktop use the same database. This password should be encrypted, so in ASP.NET MVC I have used Identity framework…
Shivraj
  • 163
  • 1
  • 2
  • 7
12
votes
1 answer

UserManager.FindAsync not working with custom implementation of UserStore

I am relatively new in ASP.NET Identity. To understand the things better I am doing a custom implementation of ASP.NET Identity. I am able to create user successfully using the custom code. However the FindAsync(username, password) functionality is…
Sayan Pal
  • 4,768
  • 5
  • 43
  • 82
12
votes
1 answer

ASP.Net Identity 2 Reset password with SMS

I'm looking to send the user an SMS when reseting their password. I already have the facilities to send a SMS, I just need a guide on how to set it up with Identity 2.0. I can't seem to find any useful info online, the reference code itself isn't…
Swifty
  • 1,422
  • 2
  • 18
  • 38
12
votes
6 answers

User (IPrincipal) not available on ApiController's constructor using Web Api 2.1 and Owin

I am Using Web Api 2.1 with Asp.Net Identity 2. I am trying to get the authenticated User on my ApiController's constructor (I am using AutoFac to inject my dependencies), but the User shows as not authenticated when the constructor is called. I am…
Mahmoud Ali
  • 1,289
  • 1
  • 16
  • 31
11
votes
3 answers

ASP.net Identity Framework - Resend Confirmation Email

I'm setting Identity Framework (2?) for my ASP.net site. I have the confirmation email working, but I can't figure out where or how to allow the user to request a resend of the confirmation email. I found this section 'Resend email confirmation…
11
votes
1 answer

Linking external logins to existing user

I'm quite new to Identity and trying to learn by watching videos in https://channel9.msdn.com/Series/Customizing-ASPNET-Authentication-with-Identity In the default ASP.Net MVC template, you can link multiple external logins (google, facebook) to…
Amila
  • 3,711
  • 3
  • 26
  • 42
11
votes
1 answer

How to implement ASP.NET Identity 2.0 in existing database?

I'm currently having existing membership implemented in ASP.NET 4.5 web forms project. The application uses EntityFramework 6.1.3 version with DbContext and currently in Database first approach. I want to migrate the old membership to use the new…