List of usage examples for org.springframework.security.access.event AuthenticationCredentialsNotFoundEvent getConfigAttributes
public Collection<ConfigAttribute> getConfigAttributes()
From source file:org.springframework.security.access.event.LoggerListener.java
public void onApplicationEvent(AbstractAuthorizationEvent event) { if (event instanceof AuthenticationCredentialsNotFoundEvent) { AuthenticationCredentialsNotFoundEvent authEvent = (AuthenticationCredentialsNotFoundEvent) event; if (logger.isWarnEnabled()) { logger.warn("Security interception failed due to: " + authEvent.getCredentialsNotFoundException() + "; secure object: " + authEvent.getSource() + "; configuration attributes: " + authEvent.getConfigAttributes()); }// ww w. j a va 2 s . c om } if (event instanceof AuthorizationFailureEvent) { AuthorizationFailureEvent authEvent = (AuthorizationFailureEvent) event; if (logger.isWarnEnabled()) { logger.warn("Security authorization failed due to: " + authEvent.getAccessDeniedException() + "; authenticated principal: " + authEvent.getAuthentication() + "; secure object: " + authEvent.getSource() + "; configuration attributes: " + authEvent.getConfigAttributes()); } } if (event instanceof AuthorizedEvent) { AuthorizedEvent authEvent = (AuthorizedEvent) event; if (logger.isInfoEnabled()) { logger.info("Security authorized for authenticated principal: " + authEvent.getAuthentication() + "; secure object: " + authEvent.getSource() + "; configuration attributes: " + authEvent.getConfigAttributes()); } } if (event instanceof PublicInvocationEvent) { PublicInvocationEvent authEvent = (PublicInvocationEvent) event; if (logger.isInfoEnabled()) { logger.info( "Security interception not required for public secure object: " + authEvent.getSource()); } } }