Spring认证Bad凭据

时间:2015-09-18 16:41:47

标签: spring

我的身份验证问题。  我无法认证Spring conf

<security:authentication-manager erase-credentials="false">
                <security:authentication-provider user-service-ref="userServices">
                        <security:password-encoder hash="md5" />
                </security:authentication-provider>
        </security:authentication-manager>  </i>`

这是我的班级 班级

 @Entity
 @Table(name="appuser")
public class UserEntity extends BaseEntity  {


    /**
     * 
     */
    private static final long serialVersionUID = -8789920463809744548L;
    private String firstname;
    private String lastname;
    private String username;
    private String password;
    public String getFirstname() {
        return firstname;
    }
    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }
    public String getLastname() {
        return lastname;
    }
    public void setLastname(String lastname) {
        this.lastname = lastname;
    }
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {

         PasswordEncoder crypto = new Md5PasswordEncoder();
         this.password = crypto.encodePassword(password, null);
        //this.password=password;
    }

日志:

18:03:33,332 DEBUG FlowHandlerMapping:108 - Mapping request with URI '/Jee/app/main' to flow with id 'main'
18:03:33,332 DEBUG FlowExecutorImpl:161 - Resuming flow execution with key 'e1s3
18:03:33,333 DEBUG SessionBindingConversationManager:67 - Locking conversation 1
18:03:33,333 DEBUG DefaultFlowExecutionRepository:106 - Getting flow execution with key 'e1s3'
18:03:33,333 DEBUG FlowDefinitionRegistryImpl:59 - Getting FlowDefinition with id 'main'
18:03:33,334 DEBUG ConditionalFlowExecutionListenerLoader:87 - Loaded [3] of possible 3 listeners for this execution request for flow 'main', the listeners to attach are list[org.springframework.webflow.persistence.JpaFlowExecutionListener@78e2abef, org.springframework.faces.webflow.FlowFacesContextLifecycleListener@698615e9, org.springframework.webflow.security.SecurityFlowExecutionListener@54e75594]
18:03:33,335 DEBUG FlowExecutionImpl:249 - Resuming in org.springframework.webflow.mvc.servlet.MvcExternalContext@7f493c26
18:03:33,335 DEBUG Flow:636 - Restoring [FlowVariable@1313c6fb name = 'user', valueFactory = [BeanFactoryVariableValueFactory@776c9285 type = UserEntity]]
18:03:33,343 DEBUG ViewState:289 - Rendering + [JSFView = '/WEB-INF/flows/main/welcome.xhtml']
18:03:33,344 DEBUG ViewState:290 -   Flash scope = map['flowRenderResponse' -> true]
18:03:33,344 DEBUG ViewState:291 -   Messages = [DefaultMessageContext@1def2e93 sourceMessages = map[[null] -> list[[empty]], 'null_summary' -> list[[FlowFacesContextMessageDelegate.FlowFacesMessageAdapter@1e898669 severity = ERROR, text = 'Bad credentials']], 'null_detail' -> list[[FlowFacesContextMessageDelegate.FlowFacesMessageAdapter@56d76728 severity = ERROR, text = 'Sorry!']]]]
18:03:33,357 DEBUG DefaultFlowExecutionRepository:121 - Putting flow execution '[FlowExecutionImpl@4e9b024 flow = 'main', flowSessions = list[[FlowSessionImpl@a2b0e01 flow = 'main', state = 'welcome', scope = map['viewScope' -> map['flowSerializedViewState' -> [FlowSerializedView@10a468de viewId = '/WEB-INF/flows/main/welcome.xhtml']], 'user' -> com.example.j2eeapp.domain.UserEntity@19e0cf5b]]]]' into repository
18:03:33,358 DEBUG DefaultFlowExecutionRepository:128 - Adding snapshot to group with id 3
18:03:33,358 DEBUG SessionBindingConversationManager:78 - Putting conversation attribute 'scope' with value map['flashScope' -> map['messagesMemento' -> map[[empty]]]]
18:03:33,358 DEBUG SessionBindingConversationManager:99 - Unlocking conversation 1

0 个答案:

没有答案