asp.net-identity

MVC5 EF6 Seed Method: Cannot insert NULL into column 'Id' table AspNetUsers

∥☆過路亽.° 提交于 2019-12-23 21:37:21
问题 Entity Framework 6, MVC5, ASP Identity 2.0. I have followed this 2 tutorials to create the login part of the web application: part 1 - part 2 I created my own AppUser class from IdentityUser Class in another library project. I also have my data context from the IdentityDbContext public class DataContext: IdentityDbContext<AppUser> { public DataContext(): base("DefaultConnection") { } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity<AppUser>().Property

Unable to resolve service for type 'Microsoft.AspNetCore.Identity.RoleManager`

家住魔仙堡 提交于 2019-12-23 17:07:13
问题 I writing code for adding roles to users in my asp.net core project Here is my Roles controller. public class RolesController : Controller { RoleManager<IdentityRole> _roleManager; UserManager<AspNetUsers> _userManager; public RolesController(RoleManager<IdentityRole> roleManager, UserManager<AspNetUsers> userManager) { _roleManager = roleManager; _userManager = userManager; } public IActionResult Index() => View(_roleManager.Roles.ToList()); public IActionResult Create() => View(); [HttpPost

What is the equivalent for IIdentityMessageService on ASP.NET Identity 3.0?

℡╲_俬逩灬. 提交于 2019-12-23 15:44:57
问题 On ASP.NET Identity 2.X we could configure a notification infrastructure trhough the IIdentityMessageService interface available at the Microsoft.AspNet.Identity.Core library, which was not upgraded to version 3.0. What are the practices for configuring messaging infrastructure on ASP.NET Identity 3.0? 回答1: It seems that there is no more email service plugged to the Asp.Net Identity. You just define your own interface. The role of ASP.NET identity is to generate and validate the e-mail

Creating a Custom Implementation using Guid and Custom Table names with Asp.net Identity 1.1 Alpha

核能气质少年 提交于 2019-12-23 15:29:50
问题 I'm drawing from different questions (listed below as I ask the question). I would like to do five things and as far as I can tell from these questions and answers... all of this can be done in my OnModelCreating method. Preface : I am using the latest nightly bits for Asp.Net Identity 1.1-alpha I would like to use "UserId" instead of Id as the property for my Users Id in the AspNetUsers table. I understand this would involve using "HasColumnName" during OnModelCreating. I would like to use

What is the recommended way to run asp.net identity functions in transaction?

一世执手 提交于 2019-12-23 15:26:30
问题 Using asp.net identity RTW version. I need to perform several actions in a transaction, including both UserMananger function calls and other operations on my DbContext (example: create new user, add it to group and perform some business-logic operations). How should I do this? My thoughts follow. TransactionScope using (var scope = new TransactionScope(TransactionScopeOption.Required)) { // Do what I need if (everythingIsOk) scope.Complete(); } The problem is: UserManager functions are all

Efficient caching of Identity related entities

北慕城南 提交于 2019-12-23 15:22:42
问题 I'm using asp.net MVC5 and asp.net Identity v2 (from the nightly releases) but I think this question still applies to Identity V1. I have a membership system and i am linking a AspNetUser entity to my membershipuser entity via a field AspUserId in the membershipuser table. public partial class membershipuser { public int id { get; set; } public string full_name { get; set; } public string address { get; set; } public string AspNetUserId { get; set; } ..... } I was wondering what is the best

Could not load type 'System.Data.Entity.DbSetExtensions' from assembly 'EntityFramework

大兔子大兔子 提交于 2019-12-23 14:54:44
问题 Updated from entityframework 6.0.0-beta1 to 6.0.0-rc1 and when logging into my MVC5 application i get the following error {"Could not load type 'System.Data.Entity.DbSetExtensions' from assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.":"System.Data.Entity.DbSetExtensions"} [System.TypeLoadException]: {"Could not load type 'System.Data.Entity.DbSetExtensions' from assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken

EF7 Identity not loading User extended properties

前提是你 提交于 2019-12-23 13:21:05
问题 I have an extended IdentityUser class which contains a reference to another entity on my DB, but whenever I try to get the User with the UserManager, the referenced entity always comes empty: My implementation of the User class public class Usuario : IdentityUser { public int ClienteID { get; set; } public virtual Cliente Cliente { get; set; } } A controller that uses the referenced property on the user [Authorize] [HttpGet] public async Task<Direccion> GET() { var usuario = await UserManager

Unable to configure AspNet.Identity using PostgreSQL

两盒软妹~` 提交于 2019-12-23 12:49:33
问题 I have a web project that was setup using SQL Server, and that now has to be migrated to PostgreSQL. I'm using Entity Framework version 6.0 with the latest version of Microsoft.AspNet.Identity to manage user credentials. I'm using VS2015 and .NET Framework 452. The project works fine with the PostgreSQL server for everything except AspNet.Identity. When I try to register a new user or do a login I get the same error message described in this question . Same error, same line but the question

logoutid not available in implicit flow with identity server4

扶醉桌前 提交于 2019-12-23 12:46:07
问题 hi I am using identity server 4 implicit flow, I am able to perform login and logout using oidc-client.js library, but when logout on the identity server -- > account controller --> Logout action parameter "logoutid" is receiving null due to which I cannot get the information about client. Samples provided by the identity team has a working example where logoutid is available. Only difference with the sample is I am using ASP.Net identity which shouldn't be an issue. can any one help me solve