Skip to content

Commit

Permalink
Fix test to match ID labs change
Browse files Browse the repository at this point in the history
  • Loading branch information
Avery-Dunn committed Aug 23, 2024
1 parent 3db1fdc commit 031e209
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@ public void acquireTokenWithAuthorizationCode_CiamCud() throws Exception {
String authorityCud = "https://login.msidlabsciam.com/fe362aec-5d43-45d1-b730-9755e60dc3b9/v2.0/";
User user = labUserProvider.getCiamCudUser();

ConfidentialClientApplication cca = ConfidentialClientApplication
.builder(user.getAppId(), CertificateHelper.getClientCertificate())
.oidcAuthority(authorityCud)
.build();
PublicClientApplication pca = PublicClientApplication.builder(
user.getAppId()).
oidcAuthority(authorityCud).
build();

assertEquals("https://login.msidlabsciam.com/fe362aec-5d43-45d1-b730-9755e60dc3b9/v2.0/.well-known/openid-configuration",
cca.authenticationAuthority.canonicalAuthorityUrl.toString());
pca.authenticationAuthority.canonicalAuthorityUrl.toString());
assertEquals("https://login.msidlabsciam.com/fe362aec-5d43-45d1-b730-9755e60dc3b9/oauth2/v2.0/authorize",
cca.authenticationAuthority.authorizationEndpoint);
pca.authenticationAuthority.authorizationEndpoint);

String authCode = acquireAuthorizationCodeAutomated(user, cca, null);
String authCode = acquireAuthorizationCodeAutomated(user, pca, null);

IAuthenticationResult result = cca.acquireToken(AuthorizationCodeParameters
IAuthenticationResult result = pca.acquireToken(AuthorizationCodeParameters
.builder(authCode,
new URI(TestConstants.LOCALHOST + httpListener.port()))
.scopes(Collections.singleton("user.read"))
Expand All @@ -119,7 +119,7 @@ public void acquireTokenWithAuthorizationCode_CiamCud() throws Exception {
assertNotNull(result.idToken());
assertEquals(user.getUpn(), result.account().username());

IAuthenticationResult resultSilent = cca.acquireTokenSilently(SilentParameters
IAuthenticationResult resultSilent = pca.acquireTokenSilently(SilentParameters
.builder(Collections.singleton("user.read"), result.account())
.build())
.get();
Expand Down

0 comments on commit 031e209

Please sign in to comment.