fixed broken user authentication info
This commit is contained in:
@ -21,8 +21,8 @@ public class UserNameActiveDirectoryRealm extends ActiveDirectoryRealm {
|
|||||||
UsernamePasswordToken upToken = (UsernamePasswordToken) token;
|
UsernamePasswordToken upToken = (UsernamePasswordToken) token;
|
||||||
// Binds using the username and password provided by the user.
|
// Binds using the username and password provided by the user.
|
||||||
LdapContext ctx = null;
|
LdapContext ctx = null;
|
||||||
try {
|
|
||||||
String userName = upToken.getUsername();
|
String userName = upToken.getUsername();
|
||||||
|
try {
|
||||||
if (principalSuffix != null) {
|
if (principalSuffix != null) {
|
||||||
if (!userName.contains(principalSuffix))
|
if (!userName.contains(principalSuffix))
|
||||||
userName += principalSuffix;
|
userName += principalSuffix;
|
||||||
@ -33,6 +33,6 @@ public class UserNameActiveDirectoryRealm extends ActiveDirectoryRealm {
|
|||||||
LdapUtils.closeContext(ctx);
|
LdapUtils.closeContext(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
return buildAuthenticationInfo(upToken.getUsername(), upToken.getPassword());
|
return buildAuthenticationInfo(userName, upToken.getPassword());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user