Correct screwy formatting.

This commit is contained in:
Luke Taylor 2005-12-22 01:42:27 +00:00
parent 3977e3b822
commit 9b5aa159aa
1 changed files with 33 additions and 33 deletions

View File

@ -97,42 +97,42 @@ public class X509AuthenticationProvider implements AuthenticationProvider,
logger.debug("X509 authentication request: " + authentication); logger.debug("X509 authentication request: " + authentication);
} }
X509Certificate clientCertificate = (X509Certificate) authentication X509Certificate clientCertificate =
.getCredentials(); (X509Certificate) authentication.getCredentials();
if (clientCertificate == null) { if (clientCertificate == null) {
throw new BadCredentialsException(messages.getMessage( throw new BadCredentialsException(messages.getMessage(
"X509AuthenticationProvider.certificateNull", "X509AuthenticationProvider.certificateNull",
"Certificate is null")); "Certificate is null"));
}
UserDetails user = userCache.getUserFromCache(clientCertificate);
if (user == null) {
logger.debug("Authenticating with certificate "
+ clientCertificate);
user = x509AuthoritiesPopulator.getUserDetails(clientCertificate);
userCache.putUserInCache(clientCertificate, user);
}
return new X509AuthenticationToken(user, clientCertificate,
user.getAuthorities());
} }
public void setMessageSource(MessageSource messageSource) { UserDetails user = userCache.getUserFromCache(clientCertificate);
this.messages = new MessageSourceAccessor(messageSource);
if (user == null) {
logger.debug("Authenticating with certificate "
+ clientCertificate);
user = x509AuthoritiesPopulator.getUserDetails(clientCertificate);
userCache.putUserInCache(clientCertificate, user);
} }
public void setX509AuthoritiesPopulator( return new X509AuthenticationToken(user, clientCertificate,
X509AuthoritiesPopulator x509AuthoritiesPopulator) { user.getAuthorities());
this.x509AuthoritiesPopulator = x509AuthoritiesPopulator;
}
public void setX509UserCache(X509UserCache cache) {
this.userCache = cache;
}
public boolean supports(Class authentication) {
return X509AuthenticationToken.class.isAssignableFrom(authentication);
}
} }
public void setMessageSource(MessageSource messageSource) {
this.messages = new MessageSourceAccessor(messageSource);
}
public void setX509AuthoritiesPopulator(
X509AuthoritiesPopulator x509AuthoritiesPopulator) {
this.x509AuthoritiesPopulator = x509AuthoritiesPopulator;
}
public void setX509UserCache(X509UserCache cache) {
this.userCache = cache;
}
public boolean supports(Class authentication) {
return X509AuthenticationToken.class.isAssignableFrom(authentication);
}
}