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); }
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" }, } })); }
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"}, } }); }
// 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"}); }
// 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" })); }