diff --git a/build.gradle b/build.gradle index cfd3ae72d..fafcc9af5 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ jacocoTestReport { } jacoco { - toolVersion = "0.8.10" + toolVersion = "0.8.12" } spotbugsMain { diff --git a/src/main/java/com/microsoft/graph/core/authentication/AzureIdentityAccessTokenProvider.java b/src/main/java/com/microsoft/graph/core/authentication/AzureIdentityAccessTokenProvider.java index 6b559400d..de4132d2c 100644 --- a/src/main/java/com/microsoft/graph/core/authentication/AzureIdentityAccessTokenProvider.java +++ b/src/main/java/com/microsoft/graph/core/authentication/AzureIdentityAccessTokenProvider.java @@ -17,11 +17,31 @@ public class AzureIdentityAccessTokenProvider extends com.microsoft.kiota.authen public AzureIdentityAccessTokenProvider(@Nonnull TokenCredential tokenCredential) { this(tokenCredential, new String[] {}, null); } - /** {@inheritDoc} */ + /** + * Creates a new instance of AzureIdentityAccessTokenProvider. + * @param tokenCredential The Azure.Identity.TokenCredential implementation to use. + * @param allowedHosts The list of allowed hosts for which to request access tokens. + * @param scopes The scopes to request access tokens for. + * @param observabilityOptions The observability options to use. + */ @SuppressWarnings("LambdaLast") public AzureIdentityAccessTokenProvider(@Nonnull final TokenCredential tokenCredential, @Nonnull final String[] allowedHosts, @Nullable final ObservabilityOptions observabilityOptions, @Nonnull final String... scopes) { - super(tokenCredential, allowedHosts, observabilityOptions, scopes); + this(tokenCredential, allowedHosts, observabilityOptions, true, scopes); + } + + /** + * Creates a new instance of AzureIdentityAccessTokenProvider. + * @param tokenCredential The Azure.Identity.TokenCredential implementation to use. + * @param allowedHosts The list of allowed hosts for which to request access tokens. + * @param scopes The scopes to request access tokens for. + * @param observabilityOptions The observability options to use. + * @param isCaeEnabled Whether to enable Continuous Access Evaluation, defaults to true. + */ + @SuppressWarnings("LambdaLast") + public AzureIdentityAccessTokenProvider(@Nonnull final TokenCredential tokenCredential, @Nonnull final String[] allowedHosts, + @Nullable final ObservabilityOptions observabilityOptions, final boolean isCaeEnabled, @Nonnull final String... scopes) { + super(tokenCredential, allowedHosts, observabilityOptions, isCaeEnabled, scopes); if (allowedHosts == null || allowedHosts.length == 0) { final HashSet allowedHostsSet = new HashSet(); allowedHostsSet.add("graph.microsoft.com"); diff --git a/src/main/java/com/microsoft/graph/core/authentication/AzureIdentityAuthenticationProvider.java b/src/main/java/com/microsoft/graph/core/authentication/AzureIdentityAuthenticationProvider.java index f88d7736d..8193dfd6f 100644 --- a/src/main/java/com/microsoft/graph/core/authentication/AzureIdentityAuthenticationProvider.java +++ b/src/main/java/com/microsoft/graph/core/authentication/AzureIdentityAuthenticationProvider.java @@ -27,6 +27,19 @@ public AzureIdentityAuthenticationProvider(@Nonnull final TokenCredential tokenC */ @SuppressWarnings("LambdaLast") public AzureIdentityAuthenticationProvider(@Nonnull final TokenCredential tokenCredential, @Nonnull final String[] allowedHosts, @Nullable final ObservabilityOptions observabilityOptions, @Nonnull final String... scopes) { - super(new AzureIdentityAccessTokenProvider(tokenCredential, allowedHosts, observabilityOptions, scopes)); + this(tokenCredential, allowedHosts, observabilityOptions, true, scopes); + } + + /** + * Creates a new instance of AzureIdentityAuthenticationProvider. + * @param tokenCredential The Azure.Identity.TokenCredential implementation to use. + * @param allowedHosts The list of allowed hosts for which to request access tokens. + * @param observabilityOptions The observability options to use. + * @param isCaeEnabled Whether to enable Continuous Access Evaluation, defaults to true. + * @param scopes The scopes to request access tokens for. + */ + @SuppressWarnings("LambdaLast") + public AzureIdentityAuthenticationProvider(@Nonnull final TokenCredential tokenCredential, @Nonnull final String[] allowedHosts, @Nullable final ObservabilityOptions observabilityOptions, final boolean isCaeEnabled, @Nonnull final String... scopes) { + super(new AzureIdentityAccessTokenProvider(tokenCredential, allowedHosts, observabilityOptions, isCaeEnabled, scopes)); } }