Search in sources :

Example 6 with CasAuthenticationPolicyFailureEvent

use of org.apereo.cas.support.events.authentication.CasAuthenticationPolicyFailureEvent in project cas by apereo.

the class CasAuthenticationAuthenticationEventListener method handleCasAuthenticationPolicyFailureEvent.

@Override
public void handleCasAuthenticationPolicyFailureEvent(final CasAuthenticationPolicyFailureEvent event) throws Exception {
    val dto = prepareCasEvent(event);
    dto.setPrincipalId(event.getAuthentication().getPrincipal().getId());
    dto.putEventId(CasAuthenticationPolicyFailureEvent.class.getSimpleName());
    this.casEventRepository.save(dto);
}
Also used : lombok.val(lombok.val) CasAuthenticationPolicyFailureEvent(org.apereo.cas.support.events.authentication.CasAuthenticationPolicyFailureEvent)

Aggregations

CasAuthenticationPolicyFailureEvent (org.apereo.cas.support.events.authentication.CasAuthenticationPolicyFailureEvent)6 lombok.val (lombok.val)3 CasAuthenticationTransactionFailureEvent (org.apereo.cas.support.events.authentication.CasAuthenticationTransactionFailureEvent)3 LinkedHashSet (java.util.LinkedHashSet)1 Set (java.util.Set)1 FailedLoginException (javax.security.auth.login.FailedLoginException)1 DefaultAuthenticationTransaction (org.apereo.cas.authentication.DefaultAuthenticationTransaction)1 AbstractCasEvent (org.apereo.cas.support.events.AbstractCasEvent)1 CasEvent (org.apereo.cas.support.events.dao.CasEvent)1 Test (org.junit.jupiter.api.Test)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1 EventListener (org.springframework.context.event.EventListener)1