Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Commit 3a0298b

Browse files
authored
Merge pull request #240 from AzureAD/dev
Release 1.6.3
2 parents c6a93d1 + dc8b731 commit 3a0298b

10 files changed

Lines changed: 31 additions & 16 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ The ADAL for Java library enables Java applications to authenticate with Azure A
1515
You can find the steps for installation and basic usage documented in the [ADAL4J Basics Wiki](https://github.com/AzureAD/azure-activedirectory-library-for-java/wiki/ADAL4J-Basics).
1616

1717
## Versions
18-
Current version - 1.6.2
18+
Current version - 1.6.3
1919

20-
Minimum recommended version - 1.6.2
20+
Minimum recommended version - 1.6.3
2121

2222
From version 1.3.0 support for handling Conditional Access claims challenge was added. You can read about CA [here](https://go.microsoft.com/fwlink/?linkid=855860) and refer this [sample](https://github.com/AzureAD/azure-activedirectory-library-for-java/tree/dev/src/samples/web-app-samples-for-adal4j) to handle it.
2323

changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Version 1.6.3
2+
=============
3+
- added client headers to user realm request
4+
15
Version 1.6.2
26
=============
37
- updated oauth2-oidc-sdk to 5.63.4

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.microsoft.azure</groupId>
55
<artifactId>adal4j</artifactId>
6-
<version>1.6.2</version>
6+
<version>1.6.3</version>
77
<packaging>jar</packaging>
88
<name>adal4j</name>
99
<description>

src/main/java/com/microsoft/aad/adal4j/AcquireTokenCallable.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,10 @@ private AdalOAuthAuthorizationGrant processPasswordGrant(
129129
.getAuthorizationGrant();
130130

131131
UserDiscoveryResponse userDiscoveryResponse = UserDiscoveryRequest.execute(
132-
context.authenticationAuthority.getUserRealmEndpoint(grant
133-
.getUsername()), context.proxy, context.sslSocketFactory);
132+
context.authenticationAuthority.getUserRealmEndpoint(grant.getUsername()),
133+
this.headers.getReadonlyHeaderMap(),
134+
context.proxy,
135+
context.sslSocketFactory);
134136
if (userDiscoveryResponse.isAccountFederated()) {
135137
WSTrustResponse response = WSTrustRequest.execute(
136138
userDiscoveryResponse.getFederationMetadataUrl(),
@@ -163,8 +165,11 @@ AuthorizationGrant getAuthorizationGrantIntegrated(String userName) throws Excep
163165
getUserRealmEndpoint(URLEncoder.encode(userName, "UTF-8"));
164166

165167
// Get the realm information
166-
UserDiscoveryResponse userRealmResponse =
167-
UserDiscoveryRequest.execute(userRealmEndpoint, context.proxy, context.sslSocketFactory);
168+
UserDiscoveryResponse userRealmResponse = UserDiscoveryRequest.execute(
169+
userRealmEndpoint,
170+
this.headers.getReadonlyHeaderMap(),
171+
context.proxy,
172+
context.sslSocketFactory);
168173

169174
if (userRealmResponse.isAccountFederated() &&
170175
"WSTrust".equalsIgnoreCase(userRealmResponse.getFederationProtocol())) {

src/main/java/com/microsoft/aad/adal4j/UserDiscoveryRequest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ class UserDiscoveryRequest {
4343

4444
}
4545

46-
static UserDiscoveryResponse execute(final String uri, final Proxy proxy,
47-
final SSLSocketFactory sslSocketFactory) throws Exception {
48-
49-
String response = HttpHelper.executeHttpGet(log, uri, HEADERS, proxy,
46+
static UserDiscoveryResponse execute(final String uri, final Map<String, String> clientDataHeaders,
47+
final Proxy proxy, final SSLSocketFactory sslSocketFactory) throws Exception {
48+
49+
HashMap<String, String> headers = new HashMap<>(HEADERS);
50+
headers.putAll(clientDataHeaders);
51+
String response = HttpHelper.executeHttpGet(log, uri, headers, proxy,
5052
sslSocketFactory);
5153
return JsonHelper.convertJsonToObject(response,
5254
UserDiscoveryResponse.class);

src/samples/public-client-app-sample/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<dependency>
1616
<groupId>com.microsoft.azure</groupId>
1717
<artifactId>adal4j</artifactId>
18-
<version>1.6.2</version>
18+
<version>1.6.3</version>
1919
</dependency>
2020
<dependency>
2121
<groupId>com.nimbusds</groupId>

src/samples/public-client-device-code-sample/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<dependency>
2020
<groupId>com.microsoft.azure</groupId>
2121
<artifactId>adal4j</artifactId>
22-
<version>1.6.2</version>
22+
<version>1.6.3</version>
2323
</dependency>
2424
<dependency>
2525
<groupId>com.nimbusds</groupId>

src/samples/web-app-samples-for-adal4j/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<dependency>
1616
<groupId>com.microsoft.azure</groupId>
1717
<artifactId>adal4j</artifactId>
18-
<version>1.6.2</version>
18+
<version>1.6.3</version>
1919
</dependency>
2020
<dependency>
2121
<groupId>com.nimbusds</groupId>

src/test/java/com/microsoft/aad/adal4j/AuthenticationContextTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import java.security.cert.CertificateEncodingException;
4040
import java.security.cert.X509Certificate;
4141
import java.util.Date;
42+
import java.util.Map;
4243
import java.util.concurrent.ExecutionException;
4344
import java.util.concurrent.ExecutorService;
4445
import java.util.concurrent.Executors;
@@ -153,7 +154,10 @@ public void testAcquireToken_Username_Password() throws Exception {
153154

154155
PowerMock.mockStatic(UserDiscoveryRequest.class);
155156
EasyMock.expect(
156-
UserDiscoveryRequest.execute(EasyMock.isA(String.class), EasyMock.isNull(Proxy.class),
157+
UserDiscoveryRequest.execute(
158+
EasyMock.isA(String.class),
159+
EasyMock.isA(Map.class),
160+
EasyMock.isNull(Proxy.class),
157161
EasyMock.isNull(SSLSocketFactory.class))).andReturn(response);
158162

159163
PowerMock.replay(ctx, response, UserDiscoveryRequest.class);

src/test/java/com/microsoft/aad/adal4j/OAuthRequestValidationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private String getRSAjwt() throws NoSuchAlgorithmException, JOSEException {
125125
// RSA signatures require a public and private RSA key pair, the public key
126126
// must be made known to the JWS recipient in order to verify the signatures
127127
KeyPairGenerator keyGenerator = KeyPairGenerator.getInstance("RSA");
128-
keyGenerator.initialize(1024);
128+
keyGenerator.initialize(2048);
129129

130130
KeyPair kp = keyGenerator.genKeyPair();
131131
RSAPublicKey publicKey = (RSAPublicKey)kp.getPublic();

0 commit comments

Comments
 (0)