microsoft / azure-devops-dotnet-samples

.NET/C# samples for integrating with Azure DevOps Services and Azure DevOps Server
https://docs.microsoft.com/azure/devops/integrate
MIT License
522 stars 519 forks source link

IdentityHttpClient.ListGroupsAsync does not return subject descriptors #190

Open BiribiriJaNai opened 5 years ago

BiribiriJaNai commented 5 years ago

Hi,

I encountered this weird behavior while trying to get identities from Azure DevOps.

While this piece of code "almost" returns what I want: var identities = await identityHttpClient.ListGroupsAsync(new Guid[] {<ScopeOfCollectionParent>});

image

I found out that some informations were missing, like the subject descriptor.

image

So I tried an alternative by querying the ReadIdentities method, using the previously obtained ids: var identities = await identityClient.ReadIdentitiesAsync(new List<Guid>(ids), includeRestrictedVisibility: true);

image

I got the missing subject descriptors but found out that some identities were not resolved like [TEAM FOUNDATION]\Enterprise Users and [TEAM FOUNDATION]\Security Service Group.

Is there anybody out there who can explain me these bahaviors? As much as possible, I would like to avoid multiple calls to IdentityHttpClient or GraphHttpClient. Thanks.