@NotNull
private TicketRegistry ticketRegistry;
public boolean authenticate(final Credentials credentials)
throws AuthenticationException {
final OpenIdCredentials c = (OpenIdCredentials) credentials;
final TicketGrantingTicket t = (TicketGrantingTicket) this.ticketRegistry
.getTicket(c.getTicketGrantingTicketId(),
TicketGrantingTicket.class);
if (t.isExpired()) {
return false;
}
return t.getAuthentication().getPrincipal().getId().equals(
c.getUsername());
}