Handle MS Graph having multiple accounts with the same identifier
adamfranco opened this issue · 1 comments
We just encountered an error in WordPress (TDX#141945) where when searching for a user by MiddleburyCollegeUID in MicrosoftGraph (the extension_a5f5e158fc8b49ce98aa89ab99fd2a76_middleburyCollegeUID
attribute), we unexpectedly came up with two results. One is a guest account and the other a middlebury account.
From Travis:
AS part of the powerfaids project the guests we create for that project flow threw Banner and have their MiddleburyCollegeUID stamped on their guest account
So from here on out we cannot assume that a MiddleburyCollegeUID will map to zero or one account in AzureAD. It might map to multiple accounts which in turn map to the same Banner person record.
Rather than throwing an exception if a search by ID returns multiple results, allow further filtering/resolution based on other attributes to find a "primary" account.
Fixed in 1.2.3.