Ejemplo n.º 1
0
        public async Task CreateTheUser()
        {
            // Create the user
            var ouContex = new PrincipalContext(ContextType.Domain, "fimdom.lab", "CN=Users,DC=fimdom,DC=lab");
            var up       = new UserPrincipal(ouContex)
            {
                SamAccountName = "ApprovalTestUser01", Enabled = true
            };

            up.SetPassword("Password1");
            var sidBytes = new byte[28];

            up?.Sid.GetBinaryForm(sidBytes, 0);

            // Create the user in identity manager
            IdmNetClient idmClient = IdmNetClientFactory.BuildClient();

            var person = new Person
            {
                DisplayName = "Approval Test User 01",
                AccountName = "ApprovalTestUser01",
                Domain      = "FIMDOM",
                ObjectSID   = sidBytes
            };

            var result = await idmClient.PostAsync(person);
        }
Ejemplo n.º 2
0
 private static async Task <IdmResource> CreateTestSearchScope(IdmNetClient it)
 {
     return(await it.PostAsync(new IdmResource
     {
         Attributes = new List <IdmAttribute>
         {
             new IdmAttribute {
                 Name = "ObjectType", Value = "SearchScopeConfiguration"
             },
             new IdmAttribute {
                 Name = "DisplayName", Value = "_TestSearchScope"
             },
             new IdmAttribute {
                 Name = "SearchScopeContext", Value = "DisplayName"
             },
             new IdmAttribute {
                 Name = "IsConfigurationType", Value = "true"
             },
             new IdmAttribute {
                 Name = "Order", Value = "1"
             },
             new IdmAttribute {
                 Name = "SearchScope", Value = "/Person"
             },
             new IdmAttribute {
                 Name = "UsageKeyword", Value = "foo"
             },
         }
     }));
 }
Ejemplo n.º 3
0
        public static async Task MainAsync()
        {
            _json  = File.ReadAllText("AttributeToObjectMapping.json");
            Client = IdmNetClientFactory.BuildClient();

            _objectTypes = await GetObjectTypes();

            await GenerateCode();
        }
Ejemplo n.º 4
0
 private static async Task<IdmResource> CreateTestSearchScope(IdmNetClient it)
 {
     return await it.PostAsync(new IdmResource
     {
         Attributes = new List<IdmAttribute>
         {
             new IdmAttribute {Name = "ObjectType", Value = "SearchScopeConfiguration"},
             new IdmAttribute {Name = "DisplayName", Value = "_TestSearchScope"},
             new IdmAttribute {Name = "SearchScopeContext", Value = "DisplayName"},
             new IdmAttribute {Name = "IsConfigurationType", Value = "true"},
             new IdmAttribute {Name = "Order", Value = "1"},
             new IdmAttribute {Name = "SearchScope", Value = "/Person"},
             new IdmAttribute {Name = "UsageKeyword", Value = "foo"},
         }
     });
 }
Ejemplo n.º 5
0
        // TODO 002: Test for AttributeTypeDescriptions, BindingDescriptions, ObjectTypeDescriptions that you can't mess with their object types
        // TODO 001: Implement Approvals
        // TODO -999: Implement the STS endpoint

        private static async Task<IdmResource> CreateTestPerson(IdmNetClient it)
        {
            return await it.PostAsync(new IdmResource {ObjectType = "Person", DisplayName = "Test User"});
        }
Ejemplo n.º 6
0
        // TODO 002: Test for AttributeTypeDescriptions, BindingDescriptions, ObjectTypeDescriptions that you can't mess with their object types
        // TODO 001: Implement Approvals
        // TODO -999: Implement the STS endpoint

        private static async Task <IdmResource> CreateTestPerson(IdmNetClient it)
        {
            return(await it.PostAsync(new IdmResource { ObjectType = "Person", DisplayName = "Test User" }));
        }