Author: bdaw
Date: 2008-05-19 07:05:59 -0400 (Mon, 19 May 2008)
New Revision: 10778
Modified:
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java
Log:
Add optional check to disable non case sensitive authentication with LDAP
Modified:
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java
===================================================================
---
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java 2008-05-18
11:07:15 UTC (rev 10777)
+++
modules/identity/branches/JBP_IDENTITY_BRANCH_1_0/identity/src/main/org/jboss/portal/identity/auth/IdentityLoginModule.java 2008-05-19
11:05:59 UTC (rev 10778)
@@ -72,6 +72,8 @@
protected String havingRole;
+ protected String validateUserNameCase;
+
public void initialize(Subject subject, CallbackHandler callbackHandler, Map
sharedState, Map options)
{
super.initialize(subject, callbackHandler, sharedState, options);
@@ -85,6 +87,7 @@
.get("membershipModuleJNDIName");
additionalRole = (String) options.get("additionalRole");
havingRole = (String) options.get("havingRole");
+ validateUserNameCase = (String) options.get("validateUserNameCase");
// Some info
log.trace("userModuleJNDIName = " + userModuleJNDIName);
@@ -93,6 +96,7 @@
log.trace("membershipModuleJNDIName = " + membershipModuleJNDIName);
log.trace("additionalRole = " + additionalRole);
log.trace("havingRole = " + havingRole);
+ log.trace("validateUserNameCase = " + validateUserNameCase);
}
private UserModule userModule;
@@ -233,6 +237,14 @@
{
throw new NoSuchUserException("UserModule returned null user
object");
}
+
+ //This is because LDAP binds can be non case sensitive
+ if (validateUserNameCase != null &&
validateUserNameCase.equalsIgnoreCase("true")
+ && !getUsername().equals(user.getUserName()))
+ {
+ return UserStatus.UNEXISTING;
+ }
+
boolean enabled = false;
try {
Object enabledS;
Show replies by date