account-management

ASP.net Identity - How does UserManager<TUser> Have Access To Roles?

微笑、不失礼 提交于 2019-12-10 17:21:21
问题 ... and we're only inside Microsoft.AspNet.Identity. (We're not even looking at the base implementation at Microsoft.AspNet.Identity.EntityFramework.) The UserManager class only takes in an IUserStore<TUser> at constructor. It does not have an IUserRoleStore<TUserRole> which I imagine would need to be accessed to determine whether UserManager.IsInRoleAsync(string, string) or not. I'm thinking UserStore's implementation would have an IsInRoleAsync(string, string) function as well (then it

GroupPrincipal.Members.Remove() doesn't work with a large AD group

与世无争的帅哥 提交于 2019-12-10 14:36:03
问题 I'm using the System.DirectoryServices.AccountManagement namespace classes to manage the membership of several groups. These groups control the population of our print accounting system and some of them are very large. I'm running into a problem removing any user from one of these large groups. I have a test program that illustrates the problem. Note that the group I'm testing is not nested, but user.IsMemberOf() also seems to have the same problem, whereas GetAuthorizationGroups() correctly

Extending GroupPrincipal and Members property

北慕城南 提交于 2019-12-08 02:26:49
问题 I want to extend the GroupPrincipal class to handle some custom properties: using System.DirectoryServices.AccountManagement; [DirectoryRdnPrefix("CN")] [DirectoryObjectClass("group")] public class MyGroupPrincipal : GroupPrincipal { // ... } How could I override the Members property for MyGroupPrincipal so that if it has a member that is a group an instance of MyGroupPrincipal and not of GroupPrincipal is returned? I would like to write e.g. MyGroupPrincipal group = GetGroup(); foreach (var

Extending GroupPrincipal and Members property

可紊 提交于 2019-12-06 07:35:46
I want to extend the GroupPrincipal class to handle some custom properties: using System.DirectoryServices.AccountManagement; [DirectoryRdnPrefix("CN")] [DirectoryObjectClass("group")] public class MyGroupPrincipal : GroupPrincipal { // ... } How could I override the Members property for MyGroupPrincipal so that if it has a member that is a group an instance of MyGroupPrincipal and not of GroupPrincipal is returned? I would like to write e.g. MyGroupPrincipal group = GetGroup(); foreach (var m in group.Members) { if (m is MyGroupPrincipal) { // always fails: m is a normal GroupPrincipal // do

How to set a binary attribute when using a AccountManagement Extension Class?

情到浓时终转凉″ 提交于 2019-12-04 11:45:54
I am using a custom class to expose some custom schema in Active Directory . I am storing a binary blob, per the project requirements this data must be stored in the AD, I can not use a external store (I would if I could). When I create the user it stores the blob fine. I also can retrieve the blob back out fine too and get all my data. The issue is if I need to update the value and I am getting errors Small example program: using System; using System.DirectoryServices.AccountManagement; namespace SandboxConsole40 { class Program { static void Main(string[] args) { using(var context = new

How to search Global Catalog (whole forest) using PrincipalContext

柔情痞子 提交于 2019-12-04 02:06:25
问题 myUserList AppUsers = new myUserList(); using (PrincipalContext pcxt = new PrincipalContext(ContextType.Domain, domainName)) { UserPrincipal User = new UserPrincipal(pcxt); User.EmailAddress = emailString; PrincipalSearcher srch = new PrincipalSearcher(User); foreach (var principal in srch.FindAll()) { var p = (UserPrincipal)principal; myUserRow User = AppUsers.NewUsersRow(); User.FirstName = p.GivenName; User.LastName = p.Surname; User.Email = p.EmailAddress; AppUsers.AddUsersRow(User); } }

Social Network (Facebook, Twitter, etc) User Account Integration (duplicate scenario)

烂漫一生 提交于 2019-12-03 03:54:50
问题 So there are definitely many tutorials out there regarding how to integrate various individual social network authentication/registration into existing user accounts. But the scenario I can't seem to find out much information about is if a user signs into your account with different social network credentials. For example: Scenario #1 User registers on site using site's authentication. User then signs in/registers on site using Facebook Connect. User then signs in/registers on site using

How do StackExchange sites associate user accounts and OpenID logins?

隐身守侯 提交于 2019-12-03 03:46:12
I love StackExhchange / StackOverflow's approach to integrating OpenID. As I understand it, the process goes something like this: If a user signs up with an OpenID provider (i.e. Google), StackOverflow (or similar site) creates an account for the user and associates the OpenID with that account. An existing user can associate multiple OpenID accounts with his/her StackExchange account. I would love to emulate this behavior because I haven't seen it nearly as user-friendly on other sites. I know StackExchange is built on ASP.NET MVC, but am not sure whether it uses the standard ASP.NET

Social Network (Facebook, Twitter, etc) User Account Integration (duplicate scenario)

大憨熊 提交于 2019-12-02 17:18:11
So there are definitely many tutorials out there regarding how to integrate various individual social network authentication/registration into existing user accounts. But the scenario I can't seem to find out much information about is if a user signs into your account with different social network credentials. For example: Scenario #1 User registers on site using site's authentication. User then signs in/registers on site using Facebook Connect. User then signs in/registers on site using Twitter. How do I integrate all of these into one account? Obviously once a user is registered, they can

Improving performance of System.DirectoryServices.AccountManagement

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 08:02:52
I have a program that will let me manage users on our terminal server that we use to demo our software. I have been trying to improve the performace of adding users to the system (It adds the main account then it adds sub accounts if needed, for example if I had a user of Demo1 and 3 sub users it would create Demo1, Demo1a, Demo1b, and Demo1c.) private void AddUsers(UserInfo userInfo, InfinityInfo infinityInfo, int subUserStart) { using (GroupPrincipal r = GroupPrincipal.FindByIdentity(context, "Remote Desktop Users")) using (GroupPrincipal u = GroupPrincipal.FindByIdentity(context, "Users"))