06-24-2012 10:23 AM
@Override
public String authenticate(String username, String password) {
AuthenticationService authenticationService = serviceRegistry
.getAuthenticationService();
try {
authenticationService
.authenticate(username, password.toCharArray());
String ticket = authenticationService.getNewTicket();
authenticationService.validate(ticket);
LOGGER.info("successful login - " + username);
return ticket;
} catch (AuthenticationException ex) {
throw new AuthenticationFailException(LOGIN_FAILED, ex);
}
}
@Override
public void logout(String username, String ticket) {
AuthenticationService authenticationService = serviceRegistry
.getAuthenticationService();
try {
// LOGGER.debug("current ticket(before logout) = " + ticket);
if (authenticationService.authenticationExists(username)) {
authenticationService.invalidateTicket(ticket);
authenticationService.invalidateUserSession(username);
}
// LOGGER.debug("Authentication exists after logout ="
// + authenticationService.authenticationExists(username));
// LOGGER.debug("current ticket(after logout)"
// + authenticationService.getCurrentTicket());
} catch (AuthenticationException e) {
throw new InvalidSessionException(INVALID_SESSION, e);
} catch (AuthenticationCredentialsNotFoundException e) {
throw new InvalidSessionException(INVALID_SESSION, e);
}
}
06-24-2012 10:43 AM
06-24-2012 12:47 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.