// If an existing CasAuthenticationToken, just check we created it
if (casauth.isAuthenticated()) {
if (key.hashCode() == casauth.getKeyHash()) {
return authentication;
} else {
throw new BadCredentialsException(textResource.getText(
"CasAuthenticationProvider.incorrectKey",
"The presented CasAuthenticationToken does not contain the expected key"));
}
}
// Ensure credentials are presented
if (StringUtils.isEmpty(String.valueOf(casauth.getCredentials()))) { throw new BadCredentialsException(
textResource.getText("CasAuthenticationProvider.noServiceTicket",
"Failed to provide a CAS service ticket to validate")); }
boolean stateless = false;
if (CAS_STATELESS_IDENTIFIER.equals(casauth.getPrincipal())) {
stateless = true;