Commit 459e99fc authored by Matt Tucker's avatar Matt Tucker Committed by matt

Fixed logic for authenticating passwords.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@4645 b35dd754-fafc-0310-a699-88a17e54d16e
parent 68b57843
......@@ -100,7 +100,7 @@ public class JDBCAuthProvider implements AuthProvider {
username = username.trim().toLowerCase();
String userPassword;
try {
userPassword = getPassword(username);
userPassword = getPasswordValue(username);
}
catch (UserNotFoundException unfe) {
throw new UnauthorizedException();
......@@ -134,7 +134,7 @@ public class JDBCAuthProvider implements AuthProvider {
username = username.trim().toLowerCase();
String password;
try {
password = getPassword(username);
password = getPasswordValue(username);
}
catch (UserNotFoundException unfe) {
throw new UnauthorizedException();
......@@ -164,6 +164,27 @@ public class JDBCAuthProvider implements AuthProvider {
if (!supportsPasswordRetrieval()) {
throw new UnsupportedOperationException();
}
return getPasswordValue(username);
}
public void setPassword(String username, String password)
throws UserNotFoundException, UnsupportedOperationException
{
throw new UnsupportedOperationException();
}
public boolean supportsPasswordRetrieval() {
return (passwordSQL != null && passwordType == PasswordType.plain);
}
/**
* Returns the value of the password field. It will be in plain text or hashed
* format, depending on the password type.
*
* @return the password value.
* @throws UserNotFoundException if the given user could not be loaded.
*/
private String getPasswordValue(String username) throws UserNotFoundException {
String password = null;
Connection con = null;
PreparedStatement pstmt = null;
......@@ -192,16 +213,6 @@ public class JDBCAuthProvider implements AuthProvider {
return password;
}
public void setPassword(String username, String password)
throws UserNotFoundException, UnsupportedOperationException
{
throw new UnsupportedOperationException();
}
public boolean supportsPasswordRetrieval() {
return (passwordSQL != null && passwordType == PasswordType.plain);
}
/**
* Indicates how the password is stored.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment