AzureAD / microsoft-authentication-library-for-java

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

Refresh tokens when request contains claims #811

Open Avery-Dunn opened 2 months ago

Avery-Dunn commented 2 months ago

The first commit in this PR refactors the logic for determining when a refresh should be performed, since it had gotten complex as different scenarios and edge cases were introduced over the years. That refactor should not affect the existing refresh behavior.

The second commit adds the existence of the claims parameter as reason to refresh, as per https://github.com/AzureAD/microsoft-authentication-library-for-java/issues/794. With this change app developers will no longer need to explicitly use the forceRefresh() API when dealing with tokens that have claims/client capabilities/etc.