asp.net-identity

Can I generate UserId for Entity Framework AspNet Identity manually?

守給你的承諾、 提交于 2019-12-12 04:48:28
问题 I need to generate new Guid value myself. Currently I created helper table with this structure: (id, aspnet_id) And whenever I need to get a User or list of users, I have to join those two tables. Can I tell Entity Framework Identity Manager to not generate new Guids but to use generated-by-me value? 回答1: You are right, the guid is not generated in the database. If you take a look at the table you'll notice that the field doesn't have a default value. Besides that, with Entity Framework

Asp.Net Identity - IdentityDbContext<TUser> causing problems for fields added to AspNetRoles table

南楼画角 提交于 2019-12-12 04:41:06
问题 IdentityDbContext causing problems for properties/fields added to AspNetRoles I believe the problem is here with IdentityDbContext taking an IdentityUser type: public class MyIdentityDb : IdentityDbContext<ApplicationUser> { public IdentityDb() : base("IdentityDb") { } } But let me explain… It is wonderful that we can add fields to the AspNetUsers table by adding properties to our ApplicationUser class that inherits from IdentityUser. Example: public class ApplicationUser : IdentityUser {

How can I log a Client in Asp.Net MVC with no user [duplicate]

六月ゝ 毕业季﹏ 提交于 2019-12-12 04:36:26
问题 This question already has an answer here : MVC 5 Identity (v2) Authentication Without Creating an Application User (1 answer) Closed 2 years ago . I have a system that I use Asp.Net Identity to log users that have claims. Each user have different access to the System functionalities because I've created different Authorization filters. My issue is this one: the system is for the management of car body work and painting. It has companies and the users log with the Asp.Net Identity technology.

Automatically Signout all active clients in Identity server once logout of any client

心不动则不痛 提交于 2019-12-12 04:34:00
问题 I'm using Identity Server 3 for Single Sign on and I'm having 3 client application. Once I logged in any of the Client application, the rest of the two applications, won't ask the Authenticate credentials. Its working fine in Log-in but in Signout the current Client gets logged out but the rest of the two applications not automatically redirecting to the log-in page of Identity Server. Kindly assist me in this regards. 回答1: Since you said in the comments that your client is a JavaScript

ASP.NET MVC Core: Error occurs after adding IdentityUser

拜拜、爱过 提交于 2019-12-12 04:32:06
问题 I'm learning to build a ASP.NET MVC Core web application. Everything works fine until I start to add Identity to it. Registered User can create many Jobs . I use the ApplicationUser.cs that comes with the project for the User . I created another DbContext for all others entities. ApplicationUser.cs in Model: public class ApplicationUser : IdentityUser { // CUSTOM PROPERTIES public string Name { get; set; } public ICollection<Job> Jobs { get; set; } } Job.cs in Model: public class Job { public

Reference to type 'AuthenticationOptions' claims it is defined in 'Microsoft.AspNetCore.Authentication', but it could not be found

南楼画角 提交于 2019-12-12 04:06:25
问题 I'm trying to run 'UseIdentityServerAuthentication' and pass in IdentityServerAuthenticationOptions and get this error in Asp.Net Core 2. Looking online it appears this was on the roadmap for Asp.Net Core 2 Preview 2, I'm running the latest release version of it so I thought it would be available by now. 回答1: I think what you want is IdentityOptions , available at https://github.com/aspnet/Identity/blob/eb3ff7fc32dbfff65a1ba6dfdca16487e0f6fc41/src/Microsoft.Extensions.Identity.Core

how to separate model library when using asp.net identity

对着背影说爱祢 提交于 2019-12-12 03:56:58
问题 I want to create application with layered architecture. I have separate Model project with only model classes Data project responsible for CodeFirst configuration, migrations, etc., Service project responsible for business logic, and preserving the data in the database using EF Dto project with classes used between Web app and service Web project with asp.net mvc application. My goal was to separate these projects so that Web project knows nothing about Model and Data - it just consumes

Authenticated REST API for a mobile app and website on ASP.NET Core with OpenIdConnect

女生的网名这么多〃 提交于 2019-12-12 03:48:26
问题 I have a pretty much boilerplate "ASP.NET Core Web Application (.NET Framework)" application, that should become a REST API, to be hosted on Azure, for use for a website & mobile app. I want to equip it with token authentication through the headers, and I have chosen for the OpenIdConnect package. I have copypasted the snippets from this page (https://github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Server) into my template, and added the app.UseOAuthValidation() call, so the code

DynamoDB avoid duplicate non-key attributes

霸气de小男生 提交于 2019-12-12 03:25:33
问题 I have a user object with these attributes. id (key), name and email And I am trying to make sure these attributes are unique in the DB. How do I prevent a put / create / save operation from succeeding, in case of either of the non-key attributes, email and name , already exists in the DB? I have a table, tblUsers with one key-attribute being the id . I then have two globally secondary indexes, each with also one key-attribute, being the email for the first index-table, and name for the

configuring one to one relationship in asp.net identity

南楼画角 提交于 2019-12-12 02:43:27
问题 this is my ApplicationUser class.I have added only one new property ---- public class ApplicationUser : IdentityUser { //public ApplicationUser() //{ // UserProfileInfo = new UserProfileInfo { ImageSize = 0, FileName = null, ImageData = 0 }; //} public string HomeTown { get; set; } public virtual UserProfileInfo UserProfileInfo { get; set; } and this is my userProfileInfo class where i want to save every user's profile pic after they have completed the registration---- public class