diff --git a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java index ed7f21efc..1a82e21be 100644 --- a/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java +++ b/src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java @@ -3018,13 +3018,19 @@ Connection connectInternal(Properties propsIn, SQLServerException.getErrString("R_IntegratedAuthenticationWithUserPassword"), null); } - if (authenticationString.equalsIgnoreCase(SqlAuthentication.ACTIVE_DIRECTORY_PASSWORD.toString()) - && ((activeConnectionProperties.getProperty(SQLServerDriverStringProperty.USER.toString()) - .isEmpty()) - || (activeConnectionProperties - .getProperty(SQLServerDriverStringProperty.PASSWORD.toString()).isEmpty()))) { - throw new SQLServerException(SQLServerException.getErrString("R_NoUserPasswordForActivePassword"), - null); + if (authenticationString.equalsIgnoreCase(SqlAuthentication.ACTIVE_DIRECTORY_PASSWORD.toString())) { + if (connectionlogger.isLoggable(Level.WARNING)) { + connectionlogger.warning(this.toString() + + "ActiveDirectoryPassword authentication method is deprecated."); + } + + if(((activeConnectionProperties.getProperty(SQLServerDriverStringProperty.USER.toString()) + .isEmpty()) + || (activeConnectionProperties + .getProperty(SQLServerDriverStringProperty.PASSWORD.toString()).isEmpty()))) { + throw new SQLServerException(SQLServerException.getErrString("R_NoUserPasswordForActivePassword"), + null); + } } if (authenticationString