Skip to content

Commit

Permalink
Added warning for ActiveDirectoryPassword authentication method
Browse files Browse the repository at this point in the history
deprecation
  • Loading branch information
machavan committed Mar 3, 2025
1 parent 7e795d4 commit 357b401
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Check warning on line 3023 in src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java#L3023

Added line #L3023 was not covered by tests
+ "ActiveDirectoryPassword authentication method is deprecated.");
}

if(((activeConnectionProperties.getProperty(SQLServerDriverStringProperty.USER.toString())

Check warning on line 3027 in src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java#L3027

Added line #L3027 was not covered by tests
.isEmpty())
|| (activeConnectionProperties
.getProperty(SQLServerDriverStringProperty.PASSWORD.toString()).isEmpty()))) {
throw new SQLServerException(SQLServerException.getErrString("R_NoUserPasswordForActivePassword"),

Check warning on line 3031 in src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java#L3031

Added line #L3031 was not covered by tests
null);
}
}

if (authenticationString
Expand Down

0 comments on commit 357b401

Please sign in to comment.