AzureAD / microsoft-authentication-library-for-java

Microsoft Authentication Library (MSAL) for Java http://aka.ms/aadv2
MIT License
280 stars 137 forks source link

API fixes #828

Closed Avery-Dunn closed 1 week ago

Avery-Dunn commented 2 weeks ago

Public and confidential applications have a number of configurable options that are not relevant for managed identity applications, so as part of some refactoring (https://github.com/AzureAD/microsoft-authentication-library-for-java/pull/715) a new parent abstract class was made to contain only configs that applied to all application types.

Doing so meant moving several public APIs in a builder class up to the new parent class's builder, and this caused a breaking change in 1.15.0 that was not caught during beta testing: as described in https://github.com/AzureAD/microsoft-authentication-library-for-java/issues/806, if you used msal4j 1.15.0 and a dependency compiled with a pre-1.15.0 version, then your project would compile fine but you would hit a NoSuchMethodError at runtime if the dependency referenced one of the moved APIs.

This PR restores the APIs to the original abstract class to be compatible with pre-1.15.0 versions, and leaves the newer APIs as-is to be compatible with those using 1.15.0. Although this creates a bit of duplicate code, it was the simplest way to ensure compatibility with all versions.

Additionally, this PR adds a default method for a new API that was introduced into an interface in 1.15.0, and adds the revapi plugin in order catch these sorts of breaking API changes going forward.