Skip to content

Commit d23200e

Browse files
authored
Bump msal4j version & add regional STS support (#22536)
* Bump msal4j version & add regional sts support * Checkstyle - unused import * Move environment variable to azure-core Configuration * Add javadocs for regional authority values
1 parent ff4cf71 commit d23200e

File tree

14 files changed

+369
-13
lines changed

14 files changed

+369
-13
lines changed

eng/versioning/external_dependencies.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ com.microsoft.azure:azure-mgmt-resources;1.3.0
168168
com.microsoft.azure:azure-mgmt-search;1.24.1
169169
com.microsoft.azure:azure-mgmt-storage;1.3.0
170170
com.microsoft.azure:azure-storage;8.0.0
171-
com.microsoft.azure:msal4j;1.10.0
171+
com.microsoft.azure:msal4j;1.10.1
172172
com.microsoft.azure:msal4j-persistence-extension;1.1.0
173173
com.sun.activation:jakarta.activation;1.2.2
174174
io.opentelemetry:opentelemetry-api;1.0.0

sdk/boms/azure-sdk-bom/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@
278278
<dependency>
279279
<groupId>com.microsoft.azure</groupId>
280280
<artifactId>msal4j</artifactId>
281-
<version>1.10.0</version>
281+
<version>1.10.1</version>
282282
</dependency>
283283

284284
<dependency>

sdk/boms/azure-spring-boot-bom/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<azure.core.version>1.17.0</azure.core.version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
4343
<azure.identity.version>1.3.1</azure.identity.version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
4444
<azure.keyvault.secret.version>4.3.0</azure.keyvault.secret.version> <!-- {x-version-update;com.azure:azure-security-keyvault-secrets;dependency} -->
45-
<azure.msal.version>1.9.1</azure.msal.version> <!-- {x-version-update;com.microsoft.azure:msal4j;external_dependency} -->
45+
<azure.msal.version>1.10.1</azure.msal.version> <!-- {x-version-update;com.microsoft.azure:msal4j;external_dependency} -->
4646
<azure.servicebus.jms.version>0.0.7</azure.servicebus.jms.version> <!-- {x-version-update;com.microsoft.azure:azure-servicebus-jms;external_dependency} -->
4747
<azure.spring.data.cosmos.version>3.8.0</azure.spring.data.cosmos.version> <!-- {x-version-update;com.azure:azure-spring-data-cosmos;dependency} -->
4848
<azure.storage.blob.version>12.12.0</azure.storage.blob.version> <!-- {x-version-update;com.azure:azure-storage-blob;dependency} -->

sdk/core/azure-core/src/main/java/com/azure/core/util/Configuration.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ public class Configuration implements Cloneable {
8888
*/
8989
public static final String PROPERTY_AZURE_IDENTITY_DISABLE_CP1 = "AZURE_IDENTITY_DISABLE_CP1";
9090

91+
/**
92+
* Name of Azure AAD regional authority.
93+
*/
94+
public static final String PROPERTY_AZURE_REGIONAL_AUTHORITY_NAME = "AZURE_REGIONAL_AUTHORITY_NAME";
95+
9196
/**
9297
* Name of the Azure resource group.
9398
*/

sdk/eventhubs/microsoft-azure-eventhubs/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<dependency>
7878
<groupId>com.microsoft.azure</groupId>
7979
<artifactId>msal4j</artifactId>
80-
<version>1.10.0</version> <!-- {x-version-update;com.microsoft.azure:msal4j;external_dependency} -->
80+
<version>1.10.1</version> <!-- {x-version-update;com.microsoft.azure:msal4j;external_dependency} -->
8181
<scope>test</scope>
8282
</dependency>
8383
<dependency>

sdk/identity/azure-identity/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# Release History
22

33
## 1.4.0-beta.1 (Unreleased)
4+
### Features Added
45

6+
- Added regional STS support to client credential types.
7+
- Added the `RegionalAuthority` type, that allows specifying Azure regions.
8+
- Added `regionalAuthority()` setter to `ClientSecretCredentialBuilder` and `ClientCertificateCredentialBuilder`.
9+
- If instead of a region, `RegionalAuthority.AutoDiscoverRegion` is specified as the value for `regionalAuthority`, MSAL will be used to attempt to discover the region.
10+
- A region can also be specified through the `AZURE_REGIONAL_AUTHORITY_NAME` environment variable.
511

612
## 1.3.1 (2021-06-08)
713

sdk/identity/azure-identity/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<dependency>
2828
<groupId>com.azure</groupId>
2929
<artifactId>azure-core</artifactId>
30-
<version>1.17.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
30+
<version>1.18.0-beta.1</version> <!-- {x-version-update;com.azure:azure-core;current} -->
3131
</dependency>
3232
<dependency>
3333
<groupId>com.azure</groupId>
@@ -37,7 +37,7 @@
3737
<dependency>
3838
<groupId>com.microsoft.azure</groupId>
3939
<artifactId>msal4j</artifactId>
40-
<version>1.10.0</version> <!-- {x-version-update;com.microsoft.azure:msal4j;external_dependency} -->
40+
<version>1.10.1</version> <!-- {x-version-update;com.microsoft.azure:msal4j;external_dependency} -->
4141
</dependency>
4242
<dependency>
4343
<groupId>com.microsoft.azure</groupId>
@@ -105,7 +105,7 @@
105105
<rules>
106106
<bannedDependencies>
107107
<includes>
108-
<include>com.microsoft.azure:msal4j:[1.10.0]</include> <!-- {x-include-update;com.microsoft.azure:msal4j;external_dependency} -->
108+
<include>com.microsoft.azure:msal4j:[1.10.1]</include> <!-- {x-include-update;com.microsoft.azure:msal4j;external_dependency} -->
109109
<include>com.microsoft.azure:msal4j-persistence-extension:[1.1.0]</include> <!-- {x-include-update;com.microsoft.azure:msal4j-persistence-extension;external_dependency} -->
110110
<include>net.java.dev.jna:jna-platform:[5.6.0]</include> <!-- {x-include-update;net.java.dev.jna:jna-platform;external_dependency} -->
111111
<include>org.linguafranca.pwdb:KeePassJava2:[2.1.4]</include> <!-- {x-include-update;org.linguafranca.pwdb:KeePassJava2;external_dependency} -->

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,19 @@ public ClientCertificateCredentialBuilder sendCertificateChain(boolean sendCerti
120120
return this;
121121
}
122122

123+
/**
124+
* Specifies either the specific regional authority, or use {@link RegionalAuthority#AUTO_DISCOVER_REGION} to
125+
* attempt to auto-detect the region. If unset, a non-regional authority will be used. This argument should be used
126+
* only by applications deployed to Azure VMs.
127+
*
128+
* @param regionalAuthority the regional authority
129+
* @return An updated instance of this builder with the regional authority configured.
130+
*/
131+
public ClientCertificateCredentialBuilder regionalAuthority(RegionalAuthority regionalAuthority) {
132+
this.identityClientOptions.setRegionalAuthority(regionalAuthority);
133+
return this;
134+
}
135+
123136
/**
124137
* Creates a new {@link ClientCertificateCredential} with the current configurations.
125138
*

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@ public ClientSecretCredentialBuilder tokenCachePersistenceOptions(TokenCachePers
6262
return this;
6363
}
6464

65+
/**
66+
* Specifies either the specific regional authority, or use {@link RegionalAuthority#AUTO_DISCOVER_REGION} to
67+
* attempt to auto-detect the region. If unset, a non-regional authority will be used. This argument should be used
68+
* only by applications deployed to Azure VMs.
69+
*
70+
* @param regionalAuthority the regional authority
71+
* @return An updated instance of this builder with the regional authority configured.
72+
*/
73+
public ClientSecretCredentialBuilder regionalAuthority(RegionalAuthority regionalAuthority) {
74+
this.identityClientOptions.setRegionalAuthority(regionalAuthority);
75+
return this;
76+
}
77+
6578
/**
6679
* Creates a new {@link ClientCertificateCredential} with the current configurations.
6780
*

0 commit comments

Comments
 (0)