Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/jacoco-test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.9.0-beta.4</version> <!-- {x-version-update;com.azure:azure-identity;current} -->
<version>1.9.0</version> <!-- {x-version-update;com.azure:azure-identity;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
Expand Down
2 changes: 1 addition & 1 deletion eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ com.azure:azure-developer-devcenter;1.0.0-beta.2;1.0.0-beta.3
com.azure:azure-e2e;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-health-insights-clinicalmatching;1.0.0-beta.1;1.0.0-beta.2
com.azure:azure-health-insights-cancerprofiling;1.0.0-beta.1;1.0.0-beta.2
com.azure:azure-identity;1.8.3;1.9.0-beta.4
com.azure:azure-identity;1.8.3;1.9.0
com.azure:azure-identity-perf;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-iot-deviceupdate;1.0.6;1.1.0-beta.1
com.azure:azure-iot-modelsrepository;1.0.0-beta.1;1.0.0-beta.2
Expand Down
2 changes: 1 addition & 1 deletion sdk/e2e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.9.0-beta.4</version> <!-- {x-version-update;com.azure:azure-identity;current} -->
<version>1.9.0</version> <!-- {x-version-update;com.azure:azure-identity;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/azure-identity-perf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.9.0-beta.4</version> <!-- {x-version-update;com.azure:azure-identity;current} -->
<version>1.9.0</version> <!-- {x-version-update;com.azure:azure-identity;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
Expand Down
12 changes: 7 additions & 5 deletions sdk/identity/azure-identity/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Release History

## 1.9.0-beta.4 (Unreleased)
## 1.9.0 (2023-05-08)

### Features Added

### Breaking Changes

### Bugs Fixed
#### Features Generally Available from v1.9.0-beta3
- Added configurable timeout for developer credentials (Azure CLI, Azure Developer CLI)
- Added `WorkloadIdentityCredential` to authenticate using workload identity in Azure Kubernetes.

### Other Changes
- renamed `disableInstanceDiscovery` to `disableAuthorityValidationAndInstanceDiscovery`.
- renamed `DefaultAzureCredential.processTimeout` to `credentialProcessTimeout`.

#### Dependency Updates
- Upgraded `azure-core` from `1.38.0` to version `1.39.0`.

## 1.8.3 (2023-05-01)

### Other Changes
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/azure-identity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ To take dependency on a particular version of the library that isn't present in
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.8.2</version>
<version>1.9.0</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/azure-identity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.9.0-beta.4</version><!-- {x-version-update;com.azure:azure-identity;current} -->
<version>1.9.0</version><!-- {x-version-update;com.azure:azure-identity;current} -->

<name>Microsoft Azure client library for Identity</name>
<description>This module contains client library for Microsoft Azure Identity.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public T additionallyAllowedTenants(List<String> additionallyAllowedTenants) {
*/
@SuppressWarnings("unchecked")

public T disableAuthorityValidationAndInstanceDiscovery() {
this.identityClientOptions.disableAuthorityValidationAndInstanceDiscovery();
public T disableInstanceDiscovery() {
this.identityClientOptions.disableInstanceDiscovery();
return (T) this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ public DefaultAzureCredentialBuilder credentialProcessTimeout(Duration credentia
*
* @return An updated instance of this builder with instance discovery disabled.
*/
public DefaultAzureCredentialBuilder disableAuthorityValidationAndInstanceDiscovery() {
this.identityClientOptions.disableAuthorityValidationAndInstanceDiscovery();
public DefaultAzureCredentialBuilder disableInstanceDiscovery() {
Comment thread
g2vinay marked this conversation as resolved.
this.identityClientOptions.disableInstanceDiscovery();
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public Mono<MsalToken> authenticateWithIntelliJ(TokenRequestContext request) {
ConfidentialClientApplication.builder(spDetails.get("client"),
ClientCredentialFactory.createFromSecret(spDetails.get("key")))
.authority(authorityUrl)
.instanceDiscovery(options.getDisableAuthorityValidationAndInstanceDiscovery());
.instanceDiscovery(options.isInstanceDiscoveryEnabled());

// If http pipeline is available, then it should override the proxy options if any configured.
if (httpPipelineAdapter != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.azure.core.util.UserAgentUtil;
import com.azure.core.util.builder.ClientBuilderUtil;
import com.azure.core.util.logging.ClientLogger;
import com.azure.core.util.logging.LogLevel;
import com.azure.core.util.serializer.JacksonAdapter;
import com.azure.core.util.serializer.SerializerAdapter;
import com.azure.core.util.serializer.SerializerEncoding;
Expand Down Expand Up @@ -213,7 +214,13 @@ ConfidentialClientApplication getConfidentialClient() {
ConfidentialClientApplication.Builder applicationBuilder =
ConfidentialClientApplication.builder(clientId, credential);
try {
applicationBuilder = applicationBuilder.authority(authorityUrl).instanceDiscovery(options.getDisableAuthorityValidationAndInstanceDiscovery());
applicationBuilder = applicationBuilder.authority(authorityUrl).instanceDiscovery(options.isInstanceDiscoveryEnabled());

if (!options.isInstanceDiscoveryEnabled()) {
LOGGER.log(LogLevel.VERBOSE, () -> "Instance discovery and authority validation is disabled. In this"
+ " state, the library will not fetch metadata to validate the specified authority host. As a"
+ " result, it is crucial to ensure that the configured authority host is valid and trustworthy.");
}
} catch (MalformedURLException e) {
throw LOGGER.logExceptionAsWarning(new IllegalStateException(e));
}
Expand Down Expand Up @@ -268,7 +275,13 @@ PublicClientApplication getPublicClient(boolean sharedTokenCacheCredential) {
+ tenantId;
PublicClientApplication.Builder builder = PublicClientApplication.builder(clientId);
try {
builder = builder.authority(authorityUrl).instanceDiscovery(options.getDisableAuthorityValidationAndInstanceDiscovery());
builder = builder.authority(authorityUrl).instanceDiscovery(options.isInstanceDiscoveryEnabled());

if (!options.isInstanceDiscoveryEnabled()) {
LOGGER.log(LogLevel.VERBOSE, () -> "Instance discovery and authority validation is disabled. In this"
+ " state, the library will not fetch metadata to validate the specified authority host. As a"
+ " result, it is crucial to ensure that the configured authority host is valid and trustworthy.");
}
} catch (MalformedURLException e) {
throw LOGGER.logExceptionAsWarning(new IllegalStateException(e));
}
Expand Down Expand Up @@ -376,7 +389,14 @@ ConfidentialClientApplication getWorkloadIdentityConfidentialClient() {
: clientId, credential);

try {
applicationBuilder = applicationBuilder.authority(authorityUrl).instanceDiscovery(options.getDisableAuthorityValidationAndInstanceDiscovery());
applicationBuilder = applicationBuilder.authority(authorityUrl).instanceDiscovery(options.isInstanceDiscoveryEnabled());

if (!options.isInstanceDiscoveryEnabled()) {
LOGGER.log(LogLevel.VERBOSE, () -> "Instance discovery and authority validation is disabled. In this"
+ " state, the library will not fetch metadata to validate the specified authority host. As a"
+ " result, it is crucial to ensure that the configured authority host is valid and trustworthy.");
}

} catch (MalformedURLException e) {
throw LOGGER.logExceptionAsWarning(new IllegalStateException(e));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ IdentityClientOptions setPerRetryPolicies(List<HttpPipelinePolicy> perRetryPolic
*
* @return the updated client options
*/
public IdentityClientOptions disableAuthorityValidationAndInstanceDiscovery() {
public IdentityClientOptions disableInstanceDiscovery() {
this.instanceDiscovery = false;
return this;
}
Expand All @@ -674,7 +674,7 @@ public IdentityClientOptions disableAuthorityValidationAndInstanceDiscovery() {
* Gets the instance discovery policy.
* @return boolean indicating if instance discovery is enabled.
*/
public boolean getDisableAuthorityValidationAndInstanceDiscovery() {
public boolean isInstanceDiscoveryEnabled() {
return this.instanceDiscovery;
}

Expand Down Expand Up @@ -737,8 +737,8 @@ public IdentityClientOptions clone() {
.setRetryPolicy(this.retryPolicy)
.setPerCallPolicies(this.perCallPolicies)
.setPerRetryPolicies(this.perRetryPolicies);
if (!getDisableAuthorityValidationAndInstanceDiscovery()) {
clone.disableAuthorityValidationAndInstanceDiscovery();
if (!isInstanceDiscoveryEnabled()) {
clone.disableInstanceDiscovery();
}
return clone;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void testCustomAuthorityHost() {
@Test
public void testDisableAuthorityValidationAndInstanceDiscovery() {
IdentityClientOptions identityClientOptions = new IdentityClientOptions();
identityClientOptions.disableAuthorityValidationAndInstanceDiscovery();
Assert.assertFalse(identityClientOptions.getDisableAuthorityValidationAndInstanceDiscovery());
identityClientOptions.disableInstanceDiscovery();
Assert.assertFalse(identityClientOptions.isInstanceDiscoveryEnabled());
}
}