Cool. That basically did it. I did end up override LdapContextSource with the following code:
Code:
/*
* 2006-08-16 reid@fivesticks.com if we're going to us the
* authentication source, it must have both principal and credentials to
* procede. If they're empty, use the defaults for anonymous access.
*/
log.info("attempting to setup authenticated environment.");
if (StringUtils.hasText(authenticationSource.getPrincipal())
&& StringUtils.hasText(authenticationSource.getCredentials())) {
log
.info("no authenticationSource credentials just yet, using anonymous");
env.put(Context.SECURITY_PRINCIPAL, authenticationSource
.getPrincipal());
// reidlog.debug("Principal: '" + userName + "'");
env.put(Context.SECURITY_CREDENTIALS, authenticationSource
.getCredentials());
} else {
env.put(Context.SECURITY_PRINCIPAL, this.getUserName());
// reidlog.debug("Principal: '" + userName + "'");
env.put(Context.SECURITY_CREDENTIALS, this.getPassword());
}
log.info("princ/cred " + env.get(Context.SECURITY_PRINCIPAL) + " / "
+ env.get(Context.SECURITY_CREDENTIALS));
In the event no credentials exist, we'll use the default. When credentials exist, we'll use those.
Any harm in this?
thanks for the input.