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

Add back Teams NPE fix #2315

Closed fadidurah closed 8 months ago

fadidurah commented 8 months ago

Previously implemented a fix for common to address this bug https://identitydivision.visualstudio.com/Engineering/_workitems/edit/2502607. Original common PR https://github.com/AzureAD/microsoft-authentication-library-common-for-android/pull/2305, which has now been reverted. During release process in february, realized that the original fix introduced a break in MSAL. Not totally clear where the break was, but realized that parts of the fix that were causing the break were unnecessary. This PR is to add back the parts of the fix that would address the teams bug, without introducing the breaking change in MSAL and Broker (we don't change the method signatures in OAuth2Strategy.requestAuthorization() or IAuthorizationStrategy.requestAuthorization()). Instead of changing signature, we use a type check.

Testing: Tested manually, was able to recover after throwing NPE Also ran common consumers pipeline check