Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TfsUserMappingTool: fix loading users from TFS connected to Active Directory #2522

Merged
merged 3 commits into from
Nov 20, 2024

Conversation

satano
Copy link
Contributor

@satano satano commented Nov 20, 2024

TfsUserMappingTool is not working correctly in our scenario, which is:

  • As our source server, we have on-premise TFS 2018 connected to on-premise Active Directory.
  • As our target server, we have Azure DevOps connected to Azure Entra ID (formerly Azure Active Directory).

TfsUserMappingTool is not working at all, because it will not load any user from our on-premise TFS server. The problem is this part:

var people = SIDS.Members.ToList().Where(x => x.Contains("\\")).Select(x => x);

It processes only users, whose SID contains \ character. But none of our users in TFS contains this. All data in SIDS.Members are SIDs of some kind of identity and we need to process them all. So the new logic is this:

  • All SIDs are processed, so identity for every one of them is retrieved from the server.
  • Identity type is checked if we can use this identity. Allowed identity types for mapping are WindowsUser and UnknownIdentityType.
    • All identities in Entra ID have type UnknownIdentityType.

This works as expected and loads correct user lists from TFS and DevOps.

@satano satano requested a review from MrHinsh as a code owner November 20, 2024 14:02
Copy link
Member

@MrHinsh MrHinsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.. yea I never tacked this as I don't have access to AD any more ;)

@MrHinsh MrHinsh enabled auto-merge November 20, 2024 14:49
@MrHinsh MrHinsh merged commit 013ae47 into nkdAgility:main Nov 20, 2024
8 checks passed
@satano satano deleted the loadUsersFromServer branch November 20, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants