Skip to content

Commit c9b7c6e

Browse files
committed
Reset changes to the patch version.
1 parent de95691 commit c9b7c6e

25 files changed

+102
-674
lines changed

sdk/identity/azure-identity/CHANGELOG.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
# Release History
22

3-
## 1.13.0-beta.2 (Unreleased)
4-
5-
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
12-
13-
## 1.13.0-beta.1 (2024-05-23)
14-
15-
### Features Added
16-
- Added `AzurePipelinesCredential` to support [Microsoft Entra Workload ID](https://learn.microsoft.com/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml) in Azure Pipelines service connections.
17-
18-
### Other Changes
19-
- Migrated Managed Identity authentication flow to utilize Msal4j MI implementation.
20-
213
## 1.12.1 (2024-05-02)
224

235
### Other Changes

sdk/identity/azure-identity/README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ To take dependency on a particular version of the library that isn't present in
4646
<dependency>
4747
<groupId>com.azure</groupId>
4848
<artifactId>azure-identity</artifactId>
49-
<version>1.12.1</version>
49+
<version>1.12.0</version>
5050
</dependency>
5151
```
5252
[//]: # ({x-version-update-end})
@@ -329,12 +329,6 @@ Not all credentials require this configuration. Credentials that authenticate th
329329
</tr>
330330
</thead>
331331
<tbody>
332-
<tr>
333-
<td><code><a href="https://learn.microsoft.com/java/api/com.azure.identity.azurepipelinescredential?view=azure-java-stable">AzurePipelinesCredential</a></td>
334-
<td>Authenticates with a <a href="https://learn.microsoft.com/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml">service connection in Azure Pipelines.</a></td>
335-
<td></td>
336-
<td></td>
337-
</tr>
338332
<tr>
339333
<td><code><a href="https://learn.microsoft.com/java/api/com.azure.identity.clientassertioncredential?view=azure-java-stable">ClientAssertionCredential</a></td>
340334
<td>authenticates a service principal using a signed client assertion</td>

sdk/identity/azure-identity/TROUBLESHOOTING.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ This troubleshooting guide covers failure investigation techniques, common error
2323
- [Troubleshoot AzurePowerShellCredential authentication issues](#troubleshoot-azurepowershellcredential-authentication-issues)
2424
- [Troubleshoot WorkloadIdentityCredential authentication issues](#troubleshoot-workloadidentitycredential-authentication-issues)
2525
- [Troubleshoot IntelliJCredential authentication issues](#troubleshoot-intellijcredential-authentication-issues)
26-
- [Troubleshoot AzurePipelinesCredential authentication issues](#troubleshoot-azurepipelinescredential-authentication-issues)
2726
- [Troubleshoot authentication timeout issues](#troubleshoot-authentication-timeout-issues)
2827
- [Get additional help](#get-additional-help)
2928

@@ -284,8 +283,6 @@ Get-AzAccessToken -ResourceUrl "https://management.core.windows.net"
284283
|---|---|---|
285284
|`CredentialUnavailableException` raised with message. "IntelliJ Authentication not available. Please log in with Azure Tools for IntelliJ plugin in the IDE."| The Credential was not able to locate the cached token to use for authentication. | Ensure that you login on the Azure Tools for IntelliJ plugin, that will populate the cache for the credential to pick up.
286285

287-
## Troubleshoot `AzurePipelinesCredential` authentication issues
288-
289286
## Troubleshoot multi-tenant authentication issues
290287
`ClientAuthenticationException`
291288

sdk/identity/azure-identity/pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.azure</groupId>
88
<artifactId>azure-identity</artifactId>
9-
<version>1.13.0-beta.2</version><!-- {x-version-update;com.azure:azure-identity;current} -->
9+
<version>1.12.1</version><!-- {x-version-update;com.azure:azure-identity;current} -->
1010

1111
<name>Microsoft Azure client library for Identity</name>
1212
<description>This module contains client library for Microsoft Azure Identity.</description>
@@ -31,12 +31,12 @@
3131
<dependency>
3232
<groupId>com.azure</groupId>
3333
<artifactId>azure-core</artifactId>
34-
<version>1.49.1</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
34+
<version>1.49.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
3535
</dependency>
3636
<dependency>
3737
<groupId>com.azure</groupId>
3838
<artifactId>azure-core-http-netty</artifactId>
39-
<version>1.15.1</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} -->
39+
<version>1.15.0</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} -->
4040
</dependency>
4141
<dependency>
4242
<groupId>com.azure</groupId>
@@ -56,7 +56,7 @@
5656
<dependency>
5757
<groupId>com.azure</groupId>
5858
<artifactId>azure-core-test</artifactId>
59-
<version>1.26.0</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
59+
<version>1.25.0</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
6060
<scope>test</scope>
6161
</dependency>
6262
<dependency>
@@ -85,7 +85,7 @@
8585
<dependency>
8686
<groupId>io.projectreactor</groupId>
8787
<artifactId>reactor-test</artifactId>
88-
<version>3.4.38</version> <!-- {x-version-update;io.projectreactor:reactor-test;external_dependency} -->
88+
<version>3.4.36</version> <!-- {x-version-update;io.projectreactor:reactor-test;external_dependency} -->
8989
<scope>test</scope>
9090
</dependency>
9191
<!-- for file lock tests, ideally should be removed in the future -->

sdk/identity/azure-identity/src/main/java/com/azure/identity/AppServiceMsiCredential.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ class AppServiceMsiCredential extends ManagedIdentityServiceCredential {
5151
* @return A publisher that emits an {@link AccessToken}.
5252
*/
5353
public Mono<AccessToken> authenticate(TokenRequestContext request) {
54-
return identityClient.authenticateWithManagedIdentityMsalClient(request);
54+
return identityClient.authenticateWithManagedIdentityConfidentialClient(request);
5555
}
5656
}

sdk/identity/azure-identity/src/main/java/com/azure/identity/ArcIdentityCredential.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ public Mono<AccessToken> authenticate(TokenRequestContext request) {
4949
+ "with the system assigned identity omit the client id when constructing the"
5050
+ " ManagedIdentityCredential.", null)));
5151
}
52-
return identityClient.authenticateWithManagedIdentityMsalClient(request);
52+
return identityClient.authenticateWithManagedIdentityConfidentialClient(request);
5353
}
5454
}

sdk/identity/azure-identity/src/main/java/com/azure/identity/AzurePipelinesCredential.java

Lines changed: 0 additions & 100 deletions
This file was deleted.

sdk/identity/azure-identity/src/main/java/com/azure/identity/AzurePipelinesCredentialBuilder.java

Lines changed: 0 additions & 89 deletions
This file was deleted.

sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientAssertionCredential.java

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
import com.azure.core.credential.TokenCredential;
99
import com.azure.core.credential.TokenRequestContext;
1010
import com.azure.core.util.logging.ClientLogger;
11-
import com.azure.identity.implementation.ClientAssertionCredentialHelper;
11+
import com.azure.identity.implementation.IdentityClient;
12+
import com.azure.identity.implementation.IdentityClientBuilder;
1213
import com.azure.identity.implementation.IdentityClientOptions;
14+
import com.azure.identity.implementation.IdentitySyncClient;
15+
import com.azure.identity.implementation.util.LoggingUtil;
1316
import reactor.core.publisher.Mono;
1417

1518
import java.util.function.Supplier;
@@ -80,8 +83,8 @@
8083
@Immutable
8184
public class ClientAssertionCredential implements TokenCredential {
8285
private static final ClientLogger LOGGER = new ClientLogger(ClientAssertionCredential.class);
83-
private final ClientAssertionCredentialHelper clientAssertionCredentialHelper;
84-
86+
private final IdentityClient identityClient;
87+
private final IdentitySyncClient identitySyncClient;
8588
/**
8689
* Creates an instance of ClientAssertionCredential.
8790
*
@@ -92,16 +95,43 @@ public class ClientAssertionCredential implements TokenCredential {
9295
*/
9396
ClientAssertionCredential(String clientId, String tenantId, Supplier<String> clientAssertion,
9497
IdentityClientOptions identityClientOptions) {
95-
clientAssertionCredentialHelper = new ClientAssertionCredentialHelper(clientId, tenantId, identityClientOptions, clientAssertion);
98+
IdentityClientBuilder builder = new IdentityClientBuilder()
99+
.tenantId(tenantId)
100+
.clientId(clientId)
101+
.clientAssertionSupplier(clientAssertion)
102+
.identityClientOptions(identityClientOptions);
103+
104+
identityClient = builder.build();
105+
identitySyncClient = builder.buildSyncClient();
96106
}
97107

98108
@Override
99109
public Mono<AccessToken> getToken(TokenRequestContext request) {
100-
return clientAssertionCredentialHelper.getToken(request);
110+
return identityClient.authenticateWithConfidentialClientCache(request)
111+
.onErrorResume(t -> Mono.empty())
112+
.switchIfEmpty(Mono.defer(() -> identityClient.authenticateWithConfidentialClient(request)))
113+
.doOnNext(token -> LoggingUtil.logTokenSuccess(LOGGER, request))
114+
.doOnError(error -> LoggingUtil.logTokenError(LOGGER, identityClient.getIdentityClientOptions(), request,
115+
error));
101116
}
102117

103118
@Override
104119
public AccessToken getTokenSync(TokenRequestContext request) {
105-
return clientAssertionCredentialHelper.getTokenSync(request);
120+
try {
121+
AccessToken token = identitySyncClient.authenticateWithConfidentialClientCache(request);
122+
if (token != null) {
123+
LoggingUtil.logTokenSuccess(LOGGER, request);
124+
return token;
125+
}
126+
} catch (Exception e) { }
127+
128+
try {
129+
AccessToken token = identitySyncClient.authenticateWithConfidentialClient(request);
130+
LoggingUtil.logTokenSuccess(LOGGER, request);
131+
return token;
132+
} catch (Exception e) {
133+
LoggingUtil.logTokenError(LOGGER, identityClient.getIdentityClientOptions(), request, e);
134+
throw e;
135+
}
106136
}
107137
}

0 commit comments

Comments
 (0)