[jboss-cvs] jboss-seam/src/main/org/jboss/seam/security/authenticator ...
Shane Bryzak
Shane_Bryzak at symantec.com
Mon Jul 31 02:45:50 EDT 2006
User: sbryzak2
Date: 06/07/31 02:45:50
Modified: src/main/org/jboss/seam/security/authenticator
ProviderAuthenticator.java
Log:
Security stuff
Revision Changes Path
1.2 +34 -1 jboss-seam/src/main/org/jboss/seam/security/authenticator/ProviderAuthenticator.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ProviderAuthenticator.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/security/authenticator/ProviderAuthenticator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ProviderAuthenticator.java 31 Jul 2006 00:51:42 -0000 1.1
+++ ProviderAuthenticator.java 31 Jul 2006 06:45:50 -0000 1.2
@@ -1,19 +1,52 @@
package org.jboss.seam.security.authenticator;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.jboss.seam.ScopeType.APPLICATION;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Startup;
import org.jboss.seam.security.Authentication;
import org.jboss.seam.security.AuthenticationException;
+import org.jboss.seam.security.provider.AuthenticationProvider;
/**
- * <p> </p>
*
* @author Shane Bryzak
*/
+ at Name("org.jboss.seam.security.Authenticator")
+ at Scope(APPLICATION)
+ at Startup
public class ProviderAuthenticator implements Authenticator
{
+ private List<AuthenticationProvider> providers = new ArrayList<AuthenticationProvider>();
+
public Authentication authenticate(Authentication authentication)
throws AuthenticationException
{
+ for (AuthenticationProvider provider : providers)
+ {
+ provider.authenticate(authentication);
+ }
return authentication;
}
+
+ public void setProviders(List<String> providerNames)
+ {
+ for (String providerName : providerNames)
+ {
+ Object provider = null;
+ try
+ {
+ provider = Class.forName(providerName).newInstance();
+ providers.add((AuthenticationProvider) provider);
+ }
+ catch (Exception ex)
+ {
+// log.error("Error creating provider", ex);
+ }
+ }
+ }
}
More information about the jboss-cvs-commits
mailing list