asp.net-identity

Does Identity Owin require LazyLoading?

半世苍凉 提交于 2019-12-01 16:04:39
tl;dr: Identity seems to require that LazyLoading NOT be disabled; is this true, and what is the cleanest workaround? I did some basic A-B testing on a simple C# ASP.NET 4.5.1 MVC-5 web application using EntityFramework 6.0.2, Identity EntityFramework 1.0.0, and Identity Owin 1.0.0 and it appears that Owin requires that lazy loading is NOT disabled in the ApplicationContext constructor. To replicate the issue just make a quick MVC app using Visual Studio 2013, use the MVC template, leave everything at the defaults except uncomment the line: 'app.UseGoogleAuthentication();' in App_Start/Startup

What is the difference between Microsoft.AspNet.Identity.Core and Microsoft.AspNetCore.Identity?

十年热恋 提交于 2019-12-01 15:58:55
I am implementing the AspNet identity in ASP.NET MVC application. But when I am going through the online materials I am quite confused about the 2 dlls Microsoft.Aspnet.Identity.Core and Microsoft.AspNetCore.Identity . I do know that Microsoft.AspNetCore.Identity is to be used in .NET Core applications but Microsoft.Aspnet.Identity.Core seems to have no recent updates and found that it is not even letting the user to login (throwing Failure in custom asp identity). So my question is can I use Microsoft.AspNetCore.Identity in MVC application or should I stick to Microsoft.Aspnet.Identity.Core ?

Does Identity Owin require LazyLoading?

*爱你&永不变心* 提交于 2019-12-01 15:57:29
问题 tl;dr: Identity seems to require that LazyLoading NOT be disabled; is this true, and what is the cleanest workaround? I did some basic A-B testing on a simple C# ASP.NET 4.5.1 MVC-5 web application using EntityFramework 6.0.2, Identity EntityFramework 1.0.0, and Identity Owin 1.0.0 and it appears that Owin requires that lazy loading is NOT disabled in the ApplicationContext constructor. To replicate the issue just make a quick MVC app using Visual Studio 2013, use the MVC template, leave

Data Protection provider across Asp.NET Core and Framework (generate password reset link)

假如想象 提交于 2019-12-01 15:55:07
I am running into this problem relating to the DataProtectionProvider , first we only had 2 .NET Framework projects, now a .NET Core project is added which confuses me how to do the following: Generate a password reset link from a .NET Framework project, and use it in the .NET Core project. Both use the same database and user table, which have been made compatible with each other. .NET Framework is still the leading project in Code-First database generation. In both .NET Frameworks projects, I use one shared code bases, which has the following code: //not sure where I got this from but it is

How to save new record with hashed password in my custom table instead of aspnet user?

两盒软妹~` 提交于 2019-12-01 15:15:39
I am using asp.net identity to create new user but getting error: Cannot insert the value NULL into column 'Id', table 'Mydb.dbo.AspNetUsers'; column does not allow nulls. INSERT fails.\r\nThe statement has been terminated But here I don't have any such table like AspNetUsers but instead I have my own table that is Users . Code: Web.config: 2 conection strings <add name="myEntities" connectionString="metadata=res://*/DataModel.csdl|res://*/DataModel.ssdl|res://*/DataModel.msl;provider=System.Data.SqlClient;provider connection string="data source=;initial catalog=mydb;user id=sa;password

AspNet Core Identity, how set options.Cookie.SameSite?

被刻印的时光 ゝ 提交于 2019-12-01 14:39:28
问题 In the latest templates and libraries used httpsonly flag. How can I turn it off? This same question is outdated and it did not have full configuration sample: AspNet Core Identity - cookie not getting set in production 回答1: In order to configure the application cookie when using Identity, you can use the ConfigureApplicationCookie method inside your Startup’s ConfigureServices : // add identity services.AddIdentity<ApplicationUser, IdentityRole>(); // configure the application cookie

How to save new record with hashed password in my custom table instead of aspnet user?

大城市里の小女人 提交于 2019-12-01 14:16:43
问题 I am using asp.net identity to create new user but getting error: Cannot insert the value NULL into column 'Id', table 'Mydb.dbo.AspNetUsers'; column does not allow nulls. INSERT fails.\r\nThe statement has been terminated But here I don't have any such table like AspNetUsers but instead I have my own table that is Users . Code: Web.config: 2 conection strings <add name="myEntities" connectionString="metadata=res://*/DataModel.csdl|res://*/DataModel.ssdl|res://*/DataModel.msl;provider=System

ASP.NET Core Identity Role, Claim and User

南楼画角 提交于 2019-12-01 14:13:52
问题 I am an ASP.NET Core beginner. I'm stuck in role, claim and user relationship. I have a user Ben , user belongs to Admin role. Admin role has claims view-page and edit-page in database. But I can't get claims and roles to be belonging to that user: (Please see comment in code) var user = await _userManager.FindByNameAsync(applicationUser.UserName); if(user != null) { var userClaims = await _userManager.GetClaimsAsync(user); // empty, WHY ? var userRoles = await _userManager.GetRolesAsync(user

MVC 5 Identity (v2) Authentication Without Creating an Application User

纵然是瞬间 提交于 2019-12-01 13:55:59
Is there a way to authenticate a session without creating an ApplicationUser in MVC 5 identity? For various reasons, I ended up using a two layered authentication system. I parse a "user" object from my custom db into session, and in various places all over the site, the existence of this object is how the logged-in status of a user is determined. I use Identity user stuff (e.g. claims, logins, etc.) at various places of the site. But at this one specific instance, I need to log in an anonymous Identity user and parse whatever user object is requested to the session. So how can I create an

MVC 5 Identity (v2) Authentication Without Creating an Application User

ε祈祈猫儿з 提交于 2019-12-01 13:02:30
问题 Is there a way to authenticate a session without creating an ApplicationUser in MVC 5 identity? For various reasons, I ended up using a two layered authentication system. I parse a "user" object from my custom db into session, and in various places all over the site, the existence of this object is how the logged-in status of a user is determined. I use Identity user stuff (e.g. claims, logins, etc.) at various places of the site. But at this one specific instance, I need to log in an