[seam-commits] Seam SVN: r12320 - in modules/security/trunk: core/src/main/java/org/jboss/seam/security/management and 3 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Mar 30 03:11:57 EDT 2010


Author: shane.bryzak at jboss.com
Date: 2010-03-30 03:11:56 -0400 (Tue, 30 Mar 2010)
New Revision: 12320

Added:
   modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/
   modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/seam-beans.xml
Modified:
   modules/security/trunk/core/src/main/java/org/jboss/seam/security/jaas/SeamLoginModule.java
   modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/IdentityManager.java
   modules/security/trunk/examples/seamspace/pom.xml
   modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/beans.xml
Log:
added xml configuration to example


Modified: modules/security/trunk/core/src/main/java/org/jboss/seam/security/jaas/SeamLoginModule.java
===================================================================
--- modules/security/trunk/core/src/main/java/org/jboss/seam/security/jaas/SeamLoginModule.java	2010-03-30 06:54:25 UTC (rev 12319)
+++ modules/security/trunk/core/src/main/java/org/jboss/seam/security/jaas/SeamLoginModule.java	2010-03-30 07:11:56 UTC (rev 12320)
@@ -125,9 +125,8 @@
          }
          else
          {
-            log.error("No authentication method defined - " +
-                  "please define authenticate-method for <security:identity/> in components.xml");
-            throw new LoginException("No authentication method defined");
+            log.error("No Authenticator bean found.");
+            throw new LoginException("No Authenticator bean found");
          }
       }
       catch (Exception ex)

Modified: modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/IdentityManager.java
===================================================================
--- modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/IdentityManager.java	2010-03-30 06:54:25 UTC (rev 12319)
+++ modules/security/trunk/core/src/main/java/org/jboss/seam/security/management/IdentityManager.java	2010-03-30 07:11:56 UTC (rev 12320)
@@ -6,9 +6,11 @@
 import java.util.Comparator;
 import java.util.List;
 
-import javax.enterprise.inject.Model;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.inject.spi.BeanManager;
 import javax.inject.Inject;
+import javax.inject.Named;
 
 import org.jboss.seam.security.Identity;
 import org.jboss.seam.security.util.Strings;
@@ -20,7 +22,7 @@
  * 
  * @author Shane Bryzak
  */
- at Model
+ at Named @ApplicationScoped
 public class IdentityManager implements Serializable
 {
    private static final long serialVersionUID = 6864253169970552893L;
@@ -41,7 +43,7 @@
    private IdentityStore identityStore;
    private IdentityStore roleIdentityStore;
    
-   @Inject
+   @PostConstruct
    public void create()
    {
       if (roleIdentityStore == null && identityStore != null)
@@ -49,11 +51,17 @@
          roleIdentityStore = identityStore;
       }
       
-      if (identityStore == null || roleIdentityStore == null)
+      if (identityStore == null)
       {
          log.warn("No identity store available - please configure an identityStore if identity " +
                "management is required.");
       }
+      
+      if (roleIdentityStore == null)
+      {
+         log.warn("No role identity store available - please configure a roleIdentityStore if identity " +
+               "management is required.");
+      }
    }
    
    public boolean createUser(String name, String password)

Modified: modules/security/trunk/examples/seamspace/pom.xml
===================================================================
--- modules/security/trunk/examples/seamspace/pom.xml	2010-03-30 06:54:25 UTC (rev 12319)
+++ modules/security/trunk/examples/seamspace/pom.xml	2010-03-30 07:11:56 UTC (rev 12320)
@@ -50,6 +50,12 @@
       </dependency>
 
       <dependency>
+         <groupId>org.jboss.seam.xml</groupId>
+         <artifactId>seam-xml-bean-config</artifactId>
+         <version>3.0.0-SNAPSHOT</version>
+      </dependency>
+
+      <dependency>
          <groupId>javax.persistence</groupId>
          <artifactId>persistence-api</artifactId>
          <version>1.0</version>

Modified: modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/beans.xml	2010-03-30 06:54:25 UTC (rev 12319)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/beans.xml	2010-03-30 07:11:56 UTC (rev 12320)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:s="urn:java:seam:core"
+       xmlns:security="urn:java:org.jboss.seam.security"
+       xmlns:idm="urn:java:org.jboss.seam.security.management"
+       xmlns:seamspace="urn:java:org.jboss.seam.security.examples.seamspace"
+       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+                           http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+                           
+   <!--idm:IdentityManager>
+      <s:extends/>
+      <idm:identityStore>
+         <s:Inject/>
+         <s:New>org.jboss.seam.security.management.JpaIdentityStore</s:New>
+      </idm:identityStore>
+   </idm:IdentityManager-->
+   
+</beans>
\ No newline at end of file

Added: modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/seam-beans.xml
===================================================================
--- modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/seam-beans.xml	                        (rev 0)
+++ modules/security/trunk/examples/seamspace/src/main/webapp/WEB-INF/classes/seam-beans.xml	2010-03-30 07:11:56 UTC (rev 12320)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://java.sun.com/xml/ns/javaee"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:s="urn:java:seam:core"
+       xmlns:security="urn:java:org.jboss.seam.security"
+       xmlns:idm="urn:java:org.jboss.seam.security.management"
+       xmlns:seamspace="urn:java:org.jboss.seam.security.examples.seamspace"
+       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+                           http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+                           
+   <idm:IdentityManager>
+      <s:extends/>
+      <idm:identityStore>
+         <s:Inject/>
+         <s:New>org.jboss.seam.security.management.JpaIdentityStore</s:New>
+      </idm:identityStore>
+   </idm:IdentityManager>
+   
+</beans>
\ No newline at end of file



More information about the seam-commits mailing list