Skip to content

Commit

Permalink
fix certificate form
Browse files Browse the repository at this point in the history
  • Loading branch information
itzikbekelmicrosoft committed Jul 11, 2024
1 parent e821217 commit b1b23e0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .run/azure-ad [hpi_run].run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<option name="passParentEnv" value="true" />
<option name="runMavenInBackground" value="true" />
<option name="skipTests" value="false" />
<option name="vmOptions" value="" />
<option name="vmOptions" value="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005" />
</MavenRunnerSettings>
</option>
<option name="myRunnerParameters">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private static GraphServiceClient<Request> createGraphClient(GraphClientCacheKey

TokenCredentialAuthProvider authProvider;

if (isEnableClientCertificate(key)) {
if (key.isEnableClientCertificate()) {
ClientCertificateCredential clientCertificateCredential = getClientCertificateCredential(key);
authProvider = new TokenCredentialAuthProvider(clientCertificateCredential);
} else {
Expand Down Expand Up @@ -139,13 +139,4 @@ public static OkHttpClient.Builder addProxyToHttpClientIfRequired(OkHttpClient.B

return builder;
}

public static boolean isEnableClientCertificate(GraphClientCacheKey key) {
SecurityRealm securityRealm = Jenkins.get().getSecurityRealm();
if (securityRealm instanceof AzureSecurityRealm) {
AzureSecurityRealm azureSecurityRealm = (AzureSecurityRealm) securityRealm;
return azureSecurityRealm.isEnableClientCertificate();
}
else return key.isEnableClientCertificate();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</f:entry>

<f:entry title="PEM Certificate" field="pemCertificate" help="/plugin/azure-ad/help/help-client-certificate.html">
<f:password />
<f:secretTextarea />
</f:entry>

<f:entry title="Tenant" field="tenant" help="/plugin/azure-ad/help/help-tenant.html">
Expand Down

0 comments on commit b1b23e0

Please sign in to comment.