From: Richard Millet Date: Thu, 29 Aug 2019 05:49:36 +0000 (-0700) Subject: DRYD-736: Adding Spring Security config for handling post-auth events. Will use... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=7d911af5eb814c9451351b5634f9eb47f59e70aa;p=tmp%2Fjakarta-migration.git DRYD-736: Adding Spring Security config for handling post-auth events. Will use to track user logins. --- diff --git a/services/JaxRsServiceProvider/src/main/webapp/WEB-INF/applicationContext-security.xml b/services/JaxRsServiceProvider/src/main/webapp/WEB-INF/applicationContext-security.xml index a12b8e497..6ebc272ca 100644 --- a/services/JaxRsServiceProvider/src/main/webapp/WEB-INF/applicationContext-security.xml +++ b/services/JaxRsServiceProvider/src/main/webapp/WEB-INF/applicationContext-security.xml @@ -21,6 +21,8 @@ http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> + + diff --git a/services/authentication/service/src/main/java/org/collectionspace/authentication/CSpaceAuthenticationSuccessEvent.java b/services/authentication/service/src/main/java/org/collectionspace/authentication/CSpaceAuthenticationSuccessEvent.java new file mode 100644 index 000000000..a325cd053 --- /dev/null +++ b/services/authentication/service/src/main/java/org/collectionspace/authentication/CSpaceAuthenticationSuccessEvent.java @@ -0,0 +1,14 @@ +package org.collectionspace.authentication; + +import org.springframework.context.ApplicationListener; +import org.springframework.security.authentication.event.AuthenticationSuccessEvent; + +public class CSpaceAuthenticationSuccessEvent implements ApplicationListener { + + @Override + public void onApplicationEvent(AuthenticationSuccessEvent event) { + // TODO Auto-generated method stub + System.out.println(); //org.springframework.security.authentication.UsernamePasswordAuthenticationToken@8a633e91: Principal: org.collectionspace.authentication.CSpaceUser@b122ec20: Username: admin@core.collectionspace.org; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_1_TENANT_ADMINISTRATOR,ROLE_SPRING_ADMIN; Credentials: [PROTECTED]; Authenticated: true; Details: {grant_type=password, username=admin@core.collectionspace.org}; Granted Authorities: ROLE_1_TENANT_ADMINISTRATOR, ROLE_SPRING_ADMIN + } + +}