Skip to content

Commit

Permalink
broker integration tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ugonnaak1 committed Oct 8, 2024
1 parent 64a462c commit 67a3359
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
public class KeyVaultSecretsProvider {
private final SecretClient secretClient;

private static final String CLIENT_ID = "2afb0add-2f32-4946-ac90-81a02aa4550e";
public static String CERTIFICATE_ALIAS = "MsalJavaAutomationRunner";
public final static String CLIENT_ID = "f62c5ae3-bf3a-4af5-afa8-a68b800396e9";
public static String CERTIFICATE_ALIAS = "LabAuth.MSIDLab.com";

private static final String WIN_KEYSTORE = "Windows-MY";
private static final String KEYSTORE_PROVIDER = "SunMSCAPI";
Expand Down Expand Up @@ -66,7 +66,7 @@ private AccessToken requestAccessTokenForAutomation() {
ConfidentialClientApplication cca =
ConfidentialClientApplication
.builder(CLIENT_ID, getClientCredentialFromKeyStore())
.authority(LabConstants.MICROSOFT_AUTHORITY)
.authority(LabConstants.MICROSOFT_AUTHORITY).sendX5c(true)
.build();
result = cca.acquireToken(ClientCredentialParameters
.builder(Collections.singleton(
Expand All @@ -85,7 +85,7 @@ private AccessToken requestAccessTokenForAutomation() {
}
}

private IClientCredential getClientCredentialFromKeyStore() {
public IClientCredential getClientCredentialFromKeyStore() {
PrivateKey key;
X509Certificate publicCertificate;
try {
Expand Down
2 changes: 1 addition & 1 deletion msal4j-brokers/src/test/java/labapi/LabConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public class LabConstants {
public final static String KEYVAULT_DEFAULT_SCOPE = "https://vault.azure.net/.default";
public final static String MSIDLAB_DEFAULT_SCOPE = "https://msidlab.com/.default";
public final static String MSIDLAB_DEFAULT_SCOPE = "https://request.msidlab.com/.default";
public final static String MSIDLAB_VAULT_URL = "https://msidlabs.vault.azure.net/";

public final static String MICROSOFT_AUTHORITY =
Expand Down
4 changes: 1 addition & 3 deletions msal4j-brokers/src/test/java/labapi/LabService.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ static void initLabApp() throws MalformedURLException {
KeyVaultSecretsProvider keyVaultSecretsProvider = new KeyVaultSecretsProvider();

String appID = keyVaultSecretsProvider.getSecret(LabConstants.APP_ID_KEY_VAULT_SECRET);
String appSecret =
keyVaultSecretsProvider.getSecret(LabConstants.APP_PASSWORD_KEY_VAULT_SECRET);

labApp = ConfidentialClientApplication
.builder(appID, ClientCredentialFactory.createFromSecret(appSecret))
.builder(appID, keyVaultSecretsProvider.getClientCredentialFromKeyStore())
.authority(LabConstants.MICROSOFT_AUTHORITY)
.build();
}
Expand Down

0 comments on commit 67a3359

Please sign in to comment.