示例#1
0
 private static IFabricGroup CreateFabricGroup(FabricGraphApiGroup groupEntry)
 {
     return(new FabricGroup
     {
         ExternalIdentifier = groupEntry.Group.Id,
         TenantId = groupEntry.TenantId,
         GroupName = groupEntry.Group.DisplayName,
         IdentityProvider = IdentityProviders.AzureActiveDirectory,
         PrincipalType = PrincipalType.Group
     });
 }
        public AzureDirectoryProviderServiceGroupTests()
        {
            _mockGraphClient = new Mock <IMicrosoftGraphApi>();
            _allGroups       = new ActiveDirectoryDataHelper().GetMicrosoftGraphGroups();
            _firstGroup      = _allGroups.First();
            _listGroups      = _allGroups.ToList();
            _emptyGroups     = new List <FabricGraphApiGroup>();

            _mockGraphClient.Setup(p => p.GetGroupCollectionsAsync(It.IsAny <string>(), null))
            .Returns(Task.FromResult(_emptyGroups));
        }
示例#3
0
 private static FabricGroup CreateFabricGroup(FabricGraphApiGroup groupEntry)
 {
     return(new FabricGroup
     {
         ExternalIdentifier = groupEntry.Group.Id,
         TenantId = groupEntry.TenantId,
         TenantAlias = groupEntry.TenantAlias ?? groupEntry.TenantId,
         GroupName = groupEntry.Group.DisplayName,
         IdentityProvider = FabricIdentityConstants.SearchIdentityProviders.AzureActiveDirectory,
         PrincipalType = FabricIdentityEnums.PrincipalType.Group
     });
 }
示例#4
0
        private static IFabricPrincipal CreateGroupPrincipal(FabricGraphApiGroup groupEntry)
        {
            var result = new FabricPrincipal
            {
                SubjectId          = groupEntry.Group.DisplayName,
                ExternalIdentifier = groupEntry.Group.Id,
                TenantId           = groupEntry.TenantId,
                DisplayName        = groupEntry.Group.DisplayName,
                IdentityProvider   = IdentityProviders.AzureActiveDirectory,
                PrincipalType      = PrincipalType.Group
            };

            return(result);
        }