diff --git a/components/authentication/azure/src/main/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProvider.java b/components/authentication/azure/src/main/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProvider.java index 572e2c5be..b95911616 100644 --- a/components/authentication/azure/src/main/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProvider.java +++ b/components/authentication/azure/src/main/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProvider.java @@ -128,13 +128,18 @@ public AzureIdentityAccessTokenProvider( "com.microsoft.kiota.authentication.additional_claims_provided", decodedClaim != null && !decodedClaim.isEmpty()); - final TokenRequestContext context = new TokenRequestContext(); - if (_scopes.isEmpty()) { - _scopes.add(uri.getScheme() + "://" + uri.getHost() + "/.default"); + List scopes; + if (!_scopes.isEmpty()) { + scopes = new ArrayList<>(_scopes); + } else { + scopes = new ArrayList<>(); + scopes.add(uri.getScheme() + "://" + uri.getHost() + "/.default"); } - context.setScopes(_scopes); + + final TokenRequestContext context = new TokenRequestContext(); + context.setScopes(scopes); span.setAttribute( - "com.microsoft.kiota.authentication.scopes", String.join("|", _scopes)); + "com.microsoft.kiota.authentication.scopes", String.join("|", scopes)); if (decodedClaim != null && !decodedClaim.isEmpty()) { context.setClaims(decodedClaim); } diff --git a/components/authentication/azure/src/test/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProviderTest.java b/components/authentication/azure/src/test/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProviderTest.java index dcce0347f..3dd49bb1f 100644 --- a/components/authentication/azure/src/test/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProviderTest.java +++ b/components/authentication/azure/src/test/java/com/microsoft/kiota/authentication/AzureIdentityAccessTokenProviderTest.java @@ -100,6 +100,6 @@ private static void assertScopes( new URI("https://graph.microsoft.com"), new HashMap<>()); List actualScopes = tokenRequestContextArgumentCaptor.getValue().getScopes(); - assertLinesMatch(actualScopes, Arrays.asList(expectedScopes)); + assertLinesMatch(Arrays.asList(expectedScopes), actualScopes); } } diff --git a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UserAgentHandlerOption.java b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UserAgentHandlerOption.java index 85f12d7d4..f39687827 100644 --- a/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UserAgentHandlerOption.java +++ b/components/http/okHttp/src/main/java/com/microsoft/kiota/http/middleware/options/UserAgentHandlerOption.java @@ -13,7 +13,7 @@ public UserAgentHandlerOption() {} private boolean enabled = true; @Nonnull private String productName = "kiota-java"; - @Nonnull private String productVersion = "1.0.6"; + @Nonnull private String productVersion = "1.1.1"; /** * Gets the product name to be used in the user agent header diff --git a/gradle.properties b/gradle.properties index 5b73eeac9..ed1814fba 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,7 +26,7 @@ org.gradle.caching=true mavenGroupId = com.microsoft.kiota mavenMajorVersion = 1 mavenMinorVersion = 1 -mavenPatchVersion = 0 +mavenPatchVersion = 1 mavenArtifactSuffix = #These values are used to run functional tests