in data/src/main/java/com/microsoft/azure/kusto/data/auth/ConnectionStringBuilder.java [502:530]
public static ConnectionStringBuilder createWithAadApplicationCertificateSubjectNameIssuer(String clusterUrl,
String applicationClientId,
List<X509Certificate> x509CertificateChain,
PrivateKey privateKey,
String authorityId) {
if (StringUtils.isEmpty(clusterUrl)) {
throw new IllegalArgumentException("clusterUrl cannot be null or empty");
}
if (StringUtils.isEmpty(applicationClientId)) {
throw new IllegalArgumentException("applicationClientId cannot be null or empty");
}
if (x509CertificateChain == null || x509CertificateChain.isEmpty()) {
throw new IllegalArgumentException("public certificate chain cannot be null or empty");
}
if (privateKey == null) {
throw new IllegalArgumentException("privateKey cannot be null");
}
ConnectionStringBuilder csb = new ConnectionStringBuilder();
csb.aadFederatedSecurity = true;
csb.clusterUrl = clusterUrl;
csb.useCertificateAuth = true;
csb.sendX509 = true;
csb.applicationClientId = applicationClientId;
csb.x509CertificateChain = x509CertificateChain;
csb.privateKey = privateKey;
csb.aadAuthorityId = authorityId;
return csb;
}