You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ca...@apache.org on 2006/09/12 10:56:37 UTC
svn commit: r442533 -
/maven/shared/trunk/maven-user/maven-user-acegi/src/main/java/org/apache/maven/user/acegi/event/authentication/UserEventPublisher.java
Author: carlos
Date: Tue Sep 12 01:56:36 2006
New Revision: 442533
URL: http://svn.apache.org/viewvc?view=rev&rev=442533
Log:
[CONTINUUM-796] Added first version of acegi event hook
Added:
maven/shared/trunk/maven-user/maven-user-acegi/src/main/java/org/apache/maven/user/acegi/event/authentication/UserEventPublisher.java (with props)
Added: maven/shared/trunk/maven-user/maven-user-acegi/src/main/java/org/apache/maven/user/acegi/event/authentication/UserEventPublisher.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-user/maven-user-acegi/src/main/java/org/apache/maven/user/acegi/event/authentication/UserEventPublisher.java?view=auto&rev=442533
==============================================================================
--- maven/shared/trunk/maven-user/maven-user-acegi/src/main/java/org/apache/maven/user/acegi/event/authentication/UserEventPublisher.java (added)
+++ maven/shared/trunk/maven-user/maven-user-acegi/src/main/java/org/apache/maven/user/acegi/event/authentication/UserEventPublisher.java Tue Sep 12 01:56:36 2006
@@ -0,0 +1,46 @@
+package org.apache.maven.user.acegi.event.authentication;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.acegisecurity.event.authentication.AuthenticationFailureBadCredentialsEvent;
+import org.acegisecurity.event.authentication.AuthenticationFailureCredentialsExpiredEvent;
+import org.springframework.context.ApplicationEvent;
+import org.springframework.context.ApplicationEventPublisher;
+
+/**
+ * Hook in Acegi event system to check for login failures and password expired.
+ *
+ * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
+ * @version $Id$
+ */
+public class UserEventPublisher
+ implements ApplicationEventPublisher
+{
+
+ public void publishEvent( ApplicationEvent event )
+ {
+ if ( event instanceof AuthenticationFailureCredentialsExpiredEvent )
+ {
+ // TODO expired password, force to change it
+ }
+ if ( event instanceof AuthenticationFailureBadCredentialsEvent )
+ {
+ // TODO bad password, increase count
+ }
+ }
+
+}
Propchange: maven/shared/trunk/maven-user/maven-user-acegi/src/main/java/org/apache/maven/user/acegi/event/authentication/UserEventPublisher.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/shared/trunk/maven-user/maven-user-acegi/src/main/java/org/apache/maven/user/acegi/event/authentication/UserEventPublisher.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"