if ( event instanceof AuthenticationSuccessEvent ) {
logger.debug( "received " + event.getClass().getSimpleName() ); //$NON-NLS-1$
logger.debug( "synchronizing current IPentahoSession with SecurityContext" ); //$NON-NLS-1$
try {
Authentication authentication = ( (AbstractAuthenticationEvent) event ).getAuthentication();
IPentahoSession pentahoSession = PentahoSessionHolder.getSession();
Assert.notNull( pentahoSession, "PentahoSessionHolder doesn't have a session" );
pentahoSession.setAuthenticated( authentication.getName() );
// audit session creation
AuditHelper.audit( pentahoSession.getId(), pentahoSession.getName(), pentahoSession.getActionName(),
pentahoSession.getObjectName(), "", MessageTypes.SESSION_START, "", "", 0, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
} catch ( Exception e ) {
logger.error( e.getLocalizedMessage(), e );
}
}
}