asp.net-identity

ASP.NET Identity User and Roles in Multisite [closed]

怎甘沉沦 提交于 2019-12-18 13:36:54
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I am trying to create a permissions system in an ASP.NET MVC Application. I have been learning the newest Identity framework - here are my requirements: A set of Hierarchical Roles for each set of functionality. So, for instance, there might be the following roles: Inherit Reader

When implementing your own IUserStore, are the “optional” interfaces on the class actually optional?

故事扮演 提交于 2019-12-18 13:12:46
问题 I'm working with Microsoft's Asp.Net Identity framework version 2, and am implementing my own IUserStore. My new class MyUserStore implements the IUserStore<MyUserClass,int> interface and the IUserPasswordStore<MyUserClass,int> , which is what is required to use it with the UserManager<MyUserClass,int> class. Or at least that's what I gathered from reading tutorials like this: "The one required interface in the identity system is IUserStore" - Scott Allen But this doesn't seem to be the case

ASP.Net Core 2.1 register custom ClaimsPrincipal

家住魔仙堡 提交于 2019-12-18 12:39:19
问题 I am creating a Windows Authentication app but the roles sit within the custom database and not on the AD so I created a custom ClaimsPrincipal to override the User.IsInRole() function that usually looks at the AD for roles. However, when running the application it still seems to be using the original code and not my CustomClaimsPrincipal. I get the error "The trust relationship between the primary domain and the trusted domain failed". In ASP.Net MVC 5 I used a Custom RoleProvider which is

How AspNet Identity with my model

对着背影说爱祢 提交于 2019-12-18 12:37:11
问题 I'm trying to go through this tutorial on the External Authentication Services (C#). I need some initial explanations to go forward. Looking inside the default template that ships MVC5, I see this: // You can add profile data for the user ... public class ApplicationUser : IdentityUser { public string HomeTown { get; set; } public DateTime? BirthDate { get; set; } } What if I want to call it User instead of ApplicationUser ? Maybe I want to add a navigation properties so I can establish

Updating records using a Repository Pattern with Entity Framework 6

删除回忆录丶 提交于 2019-12-18 12:22:04
问题 I'm writing a simple blog application and trying to establish CRUD operations in my generic repository pattern but I'm getting an error on my update method that says: 'System.Data.Entity.DbSet' does not contain a definition for 'Entry' and no extension method 'Entry' accepting a first argument of type 'System.Data.Entity.DbSet' could be found (are you missing a using directive or an assembly reference?) I followed a post that explained how to 'fake' Entry() by adding additional level of

How to login with “UserName” instead of “Email” in MVC Identity?

大兔子大兔子 提交于 2019-12-18 12:14:21
问题 I need to set my login to use username instead of email address, how can I change it? 回答1: It's actually using the e-mail address as the username, so in the ASPNetUsers table, you'll see both the username and email fields with the email address. Go into the AccountController, look for Register method (POST). Change this: var user = new ApplicationUser { UserName = model.Email, Email = model.Email}; to this: var user = new ApplicationUser { UserName = model.UserName, Email = model.Email };

Identity password reset token is invalid

给你一囗甜甜゛ 提交于 2019-12-18 12:13:37
问题 I'm writting MVC 5 and using Identity 2.0. Now I m trying to reset password. But i always getting "invalid token" error for reset password token. public class AccountController : Controller { public UserManager<ApplicationUser> UserManager { get; private set; } public AccountController() : this(new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()))) { } and i set DataProtectorTokenProvider, public AccountController(UserManager<ApplicationUser> userManager

Email Token Expiring After 15 mins - Asp Identity 2.0 API

百般思念 提交于 2019-12-18 11:45:45
问题 I'm facing a strange issue in Asp Dot Net Identity API 2.0 API. When an user signs up, I send a confirmation email to the user. And if the user confirms his / her account within 15 mins of signing up, the "ConfirmEmailAsync" method seems to be working. But after 15 mins, if I try to confirm the email address, I'm getting a "Invalid Token" error. Is there a way to set the token expiry time? A really frustrating issue and it's becoming very hard to troubleshoot. Can anyone help please? 回答1:

ASP.NET Identity with multiple applications

北城余情 提交于 2019-12-18 11:33:16
问题 so our organization is developing some new web apps using asp.net mvc and web api. we decided to not use active directory for authentication/authorization purposes so it looks like asp.net identity with entity framework might work. looking at the database schema i don't see an applications table so we can have one central repository for user credentials and application access. is this where claims come in? how would that look; user -> app -> role -> permissions also, one of our goals is to

Creating inheritance users from base asp.net identity user

夙愿已清 提交于 2019-12-18 11:13:36
问题 I have problem in which i would like to create N, two in the example, user objects (e.g. Customer & Supplier) which all inherent from the asp.net IdentityUser object. These object have very different additional data besides the the data from the IdentityUser. I would like to use the IdentityUser user as this gives me a flexible way of taking care of authentication and authorization. This example has been very stripped down but should supply sufficient information concerning the not being able