asp.net-identity-2

How to check password manually in Asp.Net identity 2?

强颜欢笑 提交于 2020-01-02 02:17:08
问题 This might actually be more of a conceptual question. In Asp.Net Identity the PasswordHasher generates a different hash for the same string every time you do: new PasswordHasher.HashPassword("myString"); Now if for some reason I need to manually compare a user's input to the password saved in the database, I will most probably get a different string when I hash the user's entered password, than the one that is stored in the database. Can someone please explain this to me? Shouldn't hashing

OAuth access and refresh token control / management on user password change

╄→гoц情女王★ 提交于 2020-01-01 19:42:28
问题 We are in the process of developing a in house mobile application and web api. We are using asp.net web api 2 with asp.net Identy 2 OAuth. I have got the api up and running and giving me a bearer token. However I want to slightly modify the process flow to something like along the lines of this: App user logs in to api with username and password. App receives Refresh-token which is valid for 30 days. App then requests an access token providing the api with the refresh token. ( Here I want to

OAuth access and refresh token control / management on user password change

删除回忆录丶 提交于 2020-01-01 19:41:13
问题 We are in the process of developing a in house mobile application and web api. We are using asp.net web api 2 with asp.net Identy 2 OAuth. I have got the api up and running and giving me a bearer token. However I want to slightly modify the process flow to something like along the lines of this: App user logs in to api with username and password. App receives Refresh-token which is valid for 30 days. App then requests an access token providing the api with the refresh token. ( Here I want to

Moq Mocking with Identity 2.0 Database

给你一囗甜甜゛ 提交于 2020-01-01 12:06:09
问题 I successfully set up an Integration Test using mocking with Moq against my BusAct controller in an MVC 5, Entity Framework 6 app based on a Simple membership database. But now I have migrated the database to Identity 2.0 and replaced the UserProfile with ApplicationUser. IdentityDbContext: (Modified from Simple membership DbContext) public class MyDb : IdentityDbContext<ApplicationUser> // DbContext { public MyDb () : base("MyApplication") { } // public virtual DbSet<UserProfile>

ASP.NET Identity 2 Invalidate Identity Difficulties

为君一笑 提交于 2020-01-01 06:45:06
问题 I have been updating my implementation of ASP.NET Identity all day today and I feel I'm on the last step, but just can't make it work. All I want to happen is to have the user's current session (if any) invalidated when something about them changes and to send them back to the login page. From the dozens of Identity related articles I've been reading today, I've settled that I have to override the OnValidateIdentity delegate, but it's just not working. Below is my code, I would really

ASP.NET Identity: Update external claims after authorization

主宰稳场 提交于 2020-01-01 02:30:06
问题 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, email, date of birth, etc...) Claims containing this info are added to the identity. 2) I need to store this info in the application Db, for the following scenarios: Admin browses the list of registered users Email subscription service will use first

Viewing user roles show the role id instead of the role name

天大地大妈咪最大 提交于 2019-12-30 11:07:18
问题 I'm trying to configure role-based authorization in ASP.NET Identity. I want to make it so that Admin users can see a list of users and their roles (on the Index page) and change the roles of individual users (on an Edit page). Here's my context: modelBuilder.Entity<IdentityUser>() .HasKey<string>(k => k.Id) .ToTable("Users"); modelBuilder.Entity<IdentityUserRole>() .HasKey(r => new { r.RoleId, r.UserId }) .ToTable("UserRoles"); modelBuilder.Entity<IdentityUserLogin>() .HasKey<string>(f => f

Viewing user roles show the role id instead of the role name

时光总嘲笑我的痴心妄想 提交于 2019-12-30 11:07:16
问题 I'm trying to configure role-based authorization in ASP.NET Identity. I want to make it so that Admin users can see a list of users and their roles (on the Index page) and change the roles of individual users (on an Edit page). Here's my context: modelBuilder.Entity<IdentityUser>() .HasKey<string>(k => k.Id) .ToTable("Users"); modelBuilder.Entity<IdentityUserRole>() .HasKey(r => new { r.RoleId, r.UserId }) .ToTable("UserRoles"); modelBuilder.Entity<IdentityUserLogin>() .HasKey<string>(f => f

ASP.NET Identity 2.1 and EF 6 - ApplicationUser relationships with other entities

人盡茶涼 提交于 2019-12-30 07:25:42
问题 Can't seem to find an answer to this one, even though what I'm doing seems like it would be common and important to most developers. In most systems with user accounts, the user table is tied to other tables in the database. That's all I want. I'm using MSSQL Express 2012 and VS 2013. I have a class library where I'm using the code-first approach to generate tables. I moved the IdentityModel class from the MVC project to this class library as well. Everything works separately - my tables are

ASP.NET Identity 2.1 and EF 6 - ApplicationUser relationships with other entities

妖精的绣舞 提交于 2019-12-30 07:25:10
问题 Can't seem to find an answer to this one, even though what I'm doing seems like it would be common and important to most developers. In most systems with user accounts, the user table is tied to other tables in the database. That's all I want. I'm using MSSQL Express 2012 and VS 2013. I have a class library where I'm using the code-first approach to generate tables. I moved the IdentityModel class from the MVC project to this class library as well. Everything works separately - my tables are