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
22 changes: 11 additions & 11 deletions src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -6831,15 +6831,15 @@ private SqlAuthenticationToken getFedAuthToken(SqlFedAuthInfo fedAuthInfo) throw

// Break out of the retry loop in successful case.
break;
} catch (DLLException adalException) {
} catch (DLLException dllException) {

// the mssql-jdbc_auth DLL return -1 for errorCategory, if unable to load the
// adalsql DLL
int errorCategory = adalException.getCategory();
// The mssql-jdbc_auth DLL returns -1 for errorCategory if unable to load the
// mssql-auth.dll
int errorCategory = dllException.getCategory();
if (-1 == errorCategory) {
MessageFormat form = new MessageFormat(
SQLServerException.getErrString("R_UnableLoadADALSqlDll"));
Object[] msgArgs = { Integer.toHexString(adalException.getState()) };
SQLServerException.getErrString("R_UnableLoadMSSQLAuthDll"));
Object[] msgArgs = { Integer.toHexString(dllException.getState()) };
throw new SQLServerException(form.format(msgArgs), null);
}

Expand All @@ -6848,21 +6848,21 @@ private SqlAuthenticationToken getFedAuthToken(SqlFedAuthInfo fedAuthInfo) throw
|| timerHasExpired(timerExpire)
|| (fedauthSleepInterval >= millisecondsRemaining)) {

String errorStatus = Integer.toHexString(adalException.getStatus());
String errorStatus = Integer.toHexString(dllException.getStatus());

if (connectionlogger.isLoggable(Level.FINER)) {
connectionlogger.fine(
toString()
+ " SQLServerConnection.getFedAuthToken.AdalException category:"
+ " SQLServerConnection.getFedAuthToken.DLLException category:"
+ errorCategory + " error: " + errorStatus);
}

MessageFormat form = new MessageFormat(
SQLServerException.getErrString("R_ADALAuthenticationMiddleErrorMessage"));
String errorCode = Integer.toHexString(adalException.getStatus()).toUpperCase();
Object[] msgArgs1 = { errorCode, adalException.getState() };
String errorCode = Integer.toHexString(dllException.getStatus()).toUpperCase();
Object[] msgArgs1 = { errorCode, dllException.getState() };
SQLServerException middleException = new SQLServerException(form.format(msgArgs1),
adalException);
dllException);

form = new MessageFormat(SQLServerException.getErrString("R_MSALExecution"));
Object[] msgArgs = { user, authenticationString };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ protected Object[][] getContents() {
{"R_GenerateSignature", "Unable to generate signature using a specified Azure Key Vault Key URL."},
{"R_SignedHashLengthError", "Signed hash length does not match the RSA key size."},
{"R_InvalidSignatureComputed", "Invalid signature of the encrypted column encryption key computed."},
{"R_UnableLoadADALSqlDll", "Unable to load adalsql.dll. Error code: 0x{0}. For details, see: http://go.microsoft.com/fwlink/?LinkID=513072"},
{"R_UnableLoadMSSQLAuthDll", "Unable to load mssql-auth.dll. Error code: 0x{0}. For details, see: http://go.microsoft.com/fwlink/?LinkID=513072"},
{"R_ADALAuthenticationMiddleErrorMessage", "Error code 0x{0}; state {1}."},
{"R_unsupportedDataTypeTVP", "Data type {0} not supported in Table-Valued Parameter."},
{"R_moreDataInRowThanColumnInTVP", "Input array is longer than the number of columns in this table."},
Expand Down
Loading