AzureAD / microsoft-authentication-library-common-for-android

Common code used by both the Active Directory Authentication Library (ADAL) and the Microsoft Authentication Library (MSAL)
MIT License
41 stars 35 forks source link

Fixed debug apps not recognized as active broker issue #2138

Closed somalaya closed 1 year ago

somalaya commented 1 year ago

Issue : Debug apps of CP and auth app were not being recognized as active broker due to a regression introduced in this PR https://github.com/AzureAD/microsoft-authentication-library-common-for-android/pull/2107/files We were only taking the first app from the knowBrokerApps list for a given pkg name. So it was always returning the release broker apps. And when debug broker apps are installed, the check for isValidBrokerPackage fails.

Fix : Made a change to look through all the matches for a given pkg name.

Testing : Added UTs and also tested from MSALTestAPp if the debug auth app is being recognized as an active broker