Skip to content
Open
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
74 changes: 57 additions & 17 deletions msal4j-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.2</version>
<version>1.7.36</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -96,7 +96,7 @@
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.14.5</version>
<version>1.17.5</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -114,7 +114,19 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.14.0</version>
<version>4.13.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.14.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -126,7 +138,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.14.0</version>
<version>2.22.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -169,7 +181,7 @@
<plugin>
<groupId>org.revapi</groupId>
<artifactId>revapi-maven-plugin</artifactId>
<version>0.15.0</version>
<version>0.15.1</version>
<configuration>
<analysisConfiguration>
<revapi.java>
Expand All @@ -183,7 +195,7 @@
<dependency>
<groupId>org.revapi</groupId>
<artifactId>revapi-java</artifactId>
<version>0.28.1</version>
<version>0.28.4</version>
</dependency>
</dependencies>
<executions>
Expand All @@ -199,7 +211,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<version>3.5.0</version>
<configuration>
<archive>
<manifest>
Expand All @@ -213,7 +225,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
<version>3.5.6</version>
<configuration>
<argLine>@{argLine} -noverify</argLine>
<skipTests>${skip.unit.tests}</skipTests>
Expand All @@ -222,7 +234,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.0</version>
<version>3.12.0</version>
<configuration>
<sourcepath>src/main/java</sourcepath>
</configuration>
Expand All @@ -238,7 +250,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<version>3.4.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -251,12 +263,12 @@
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>3.1.11</version>
<version>4.2.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<version>3.15.0</version>
<configuration>
<source>8</source>
<target>8</target>
Expand All @@ -265,7 +277,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
<version>3.6.0</version>
<executions>
<execution>
<id>add-test-source</id>
Expand All @@ -284,7 +296,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.0</version>
<version>3.5.6</version>
<executions>
<execution>
<goals>
Expand All @@ -295,6 +307,7 @@
</executions>
<configuration>
<skipTests>${skip.integration.tests}</skipTests>
<rerunFailingTestsCount>1</rerunFailingTestsCount>
<systemPropertyVariables>
<adfs.disabled>${adfs.disabled}</adfs.disabled>
</systemPropertyVariables>
Expand All @@ -303,7 +316,7 @@
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<version>5.2.0</version>
<version>6.4.0</version>
<executions>
<execution>
<goals>
Expand All @@ -315,7 +328,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<version>0.8.13</version>
<executions>
<execution>
<goals>
Expand All @@ -329,11 +342,38 @@
<goal>report</goal>
</goals>
</execution>
<execution>
<id>jacoco-check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<haltOnFailure>false</haltOnFailure>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.65</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>0.50</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<version>3.11.0</version>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,6 @@ void acquireTokenInteractive_ADFSv2022() {
assertAcquireTokenCommon(user, app.getAppId(), app.getAuthority() + "organizations/", TestConstants.ADFS_SCOPE);
}

@Test
void acquireTokenWithAuthorizationCode_B2C_Local() {
AppConfig app = LabResponseHelper.getAppConfig(APP_B2C);
UserConfig user = LabResponseHelper.getUserConfig(USER_B2C);

assertAcquireTokenB2C(user, TestConstants.B2C_AUTHORITY, app.getAppId());
}

@Test
void acquireTokenWithAuthorizationCode_B2C_LegacyFormat() {
AppConfig app = LabResponseHelper.getAppConfig(APP_B2C);
UserConfig user = LabResponseHelper.getUserConfig(USER_B2C);

assertAcquireTokenB2C(user, TestConstants.B2C_AUTHORITY_LEGACY_FORMAT, app.getAppId());
}

@Test
void acquireTokenInteractive_ManagedUser_InstanceAware() {
AppConfig app = LabResponseHelper.getAppConfig(APP_ARLINGTON);
Expand All @@ -86,7 +70,7 @@ void acquireTokenInteractive_ManagedUser_InstanceAware() {
assertAcquireTokenInstanceAware(user, app.getAppId(), TestConstants.ARLINGTON_TENANT_ID);
}

//@Test -disabled to avoid test failures, HTML page seems to have changed as this test cannot find the username input element
@Test
void acquireTokenInteractive_Ciam() {
AppConfig app = LabResponseHelper.getAppConfig(APP_CIAM);
UserConfig user = LabResponseHelper.getUserConfig(USER_CIAM);
Expand Down Expand Up @@ -115,7 +99,7 @@ void acquireTokenInteractive_Ciam() {

InteractiveRequestParameters parameters = InteractiveRequestParameters
.builder(url)
.scopes(Collections.singleton("TestConstants.USER_READ_SCOPE"))
.scopes(Collections.singleton(TestConstants.USER_READ_SCOPE))
.extraQueryParameters(extraQueryParameters)
.systemBrowserOptions(browserOptions)
.build();
Expand Down Expand Up @@ -143,22 +127,6 @@ private void assertAcquireTokenCommon(UserConfig user, String appId, String auth
assertEquals(user.getUpn(), result.account().username());
}

private void assertAcquireTokenB2C(UserConfig user, String authority, String appId) {

PublicClientApplication pca;
try {
pca = PublicClientApplication.builder(
appId).
b2cAuthority(authority + TestConstants.B2C_SIGN_IN_POLICY).
build();
} catch (MalformedURLException ex) {
throw new RuntimeException(ex.getMessage());
}

IAuthenticationResult result = acquireTokenInteractive(user, pca, appId);
IntegrationTestHelper.assertAccessAndIdTokensNotNull(result);
}

private void assertAcquireTokenInstanceAware(UserConfig user, String appId, String tenantId) {
PublicClientApplication pca = IntegrationTestHelper.createPublicApp(appId, TestConstants.MICROSOFT_AUTHORITY_HOST + tenantId);

Expand Down
Loading
Loading