[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4267) Token-based Remember-me is not working

Johnny Ren (JIRA) jira-events at lists.jboss.org
Tue Jun 23 20:09:56 EDT 2009


Token-based Remember-me is not working
--------------------------------------

                 Key: JBSEAM-4267
                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4267
             Project: Seam
          Issue Type: Bug
          Components: Security
    Affects Versions: 2.1.2.GA, 2.1.1.GA
         Environment: JBOSS 4.2.3
            Reporter: Johnny Ren


Steps to reproduce the problem: 

Step1: create an AuthenticationToken class as described in 15.3.5.1.

Stpe2: Modify the components.xml as described in 15.3.5.1.

        <security:jpa-token-stor token-class="org.jboss.seam.example.jpa.AuthenticationToken"/>
    <security:remember-me mode="autoLogin"/>
   <event type="org.jboss.seam.security.notLoggedIn">
        <action execute="#{redirect.captureCurrentView}"/>
        <action execute="#{identity.tryLogin()}"/>
    </event>
    <event type="org.jboss.seam.security.loginSuccessful">
        <action execute="#{redirect.returnToCapturedView}"/>
    </event>

Step 3: Modify the home.xhtml under examples\jpa\view as described in 15.3.5


   <div>
     <h:outputLabel for="rememberMe" value="Remember me"/>
    <h:selectBooleanCheckbox id="rememberMe" value="#{rememberMe.enabled}"/>
  </div>
Step 4: execute ant jboss
Step 5: deploy the jboss-seam-jpa.war 

Step 6: go to http://localhost:8080/jboss-seam-jpa/home.seam

Step 7: Select Remember me and use "demo/demo" to login.

Result: 

javax.servlet.ServletException: #{identity.login}: org.jboss.seam.security.management.IdentityManagementException: Could not create account



package org.jboss.seam.example.jpa;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import org.jboss.seam.annotations.security.TokenUsername;
import org.jboss.seam.annotations.security.TokenValue;

/**
 *
 */

@Entity
public class AuthenticationToken implements Serializable { 
   private Integer tokenId;
   private String username;
   private String value;
       @Id @GeneratedValue
   public Integer getTokenId() {
      return tokenId;
   }
       public void setTokenId(Integer tokenId) {
      this.tokenId = tokenId;
   }
       @TokenUsername
   public String getUsername() {
      return username;
   }
       public void setUsername(String username) {
      this.username = username;
   }
       @TokenValue
   public String getValue() {
      return value;
   }
       public void setValue(String value) {
      this.value = value;
   }
}




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list