]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-736: Adding Spring Security config for handling post-auth events. Will use...
authorRichard Millet <remillet@gmail.com>
Thu, 29 Aug 2019 05:49:36 +0000 (22:49 -0700)
committerRichard Millet <remillet@gmail.com>
Thu, 19 Sep 2019 18:19:23 +0000 (11:19 -0700)
services/JaxRsServiceProvider/src/main/webapp/WEB-INF/applicationContext-security.xml
services/authentication/service/src/main/java/org/collectionspace/authentication/CSpaceAuthenticationSuccessEvent.java [new file with mode: 0644]

index a12b8e497f564e1f244209c1e1748e75f9c2209e..6ebc272ca6e41632c28d4086d4219fd86876d32e 100644 (file)
@@ -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">
 
+       <bean class="org.collectionspace.authentication.CSpaceAuthenticationSuccessEvent" />
+
     <bean class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
         <!-- Read properties from security.properties file in the classpath. -->
         <!-- Values in the file override the defaults set below. -->
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 (file)
index 0000000..a325cd0
--- /dev/null
@@ -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<AuthenticationSuccessEvent> {
+
+       @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
+       }
+
+}