开发者

Can't login with Seam's Identity Management

开发者 https://www.devze.com 2023-03-24 23:38 出处:网络
I\'m trying to create a login in Seam 2 with Seam\'s Identity Management. I\'m using mysql 5.1 for RDB. I already created a login page and modified components.xml for authentication. But here is the p

I'm trying to create a login in Seam 2 with Seam's Identity Management. I'm using mysql 5.1 for RDB. I already created a login page and modified components.xml for authentication. But here is the problem. When i click login button from UI, it throws login failed. But i can observe from logs it queries DB as displayd below.

10:27:40,670 INFO  [STDOUT] Hibernate: 
10:27:40,670 INFO  [STDOUT]     select
10:27:40,671 INFO  [STDOUT]         user0_.id as id10_,
10:27:40,671 INFO  [STDOUT]         user0_.email as email10_,
10:27:40,671 INFO  [STDOUT]         user0_.password as password10_,
10:27:40,671 INFO  [STDOUT]         user0_.userName as userName10_,
10:27:40,671 INFO  [STDOUT]         user0_.version as version10_ 
10:27:40,671 INFO  [STDOUT]     from
10:27:40,671 INFO  [STDOUT]         User user0_ 
10:27:40,671 INFO  [STDOUT]     where
10:27:40,672 INFO  [STDOUT]         user0_.userName=? limit ?

But either cant match userName&password or something else, login is not successfull. Here is my login.xhtml page

<h:form id="loginForm">

            <rich:panel>
                <f:facet name="header">Login</f:facet>

                <p>Please login here</p>

                <div class="dialog">
                    <h:panelGrid columns="2" rowClasses="prop"
                        columnClasses="name,value">
                        <h:outputLabel for="username">Username</h:outputLabel>
                        <h:inputText id="username" value="#{credentials.username}" />
                        <h:outputLabel for="password">Password</h:outputLabel>
                        <h:inputSecret id="password" value="#{credentials.password}" />
                        <h:outputLabel for="rememberMe">Remember me</h:outputLabel>
                        <h:selectBooleanCheckbox id="rememberMe"
                            value="#{rememberMe.enabled}" />
                    </h:panelGrid>
                </div>

            </rich:panel>

            <div class="actionButtons">
                <h:commandButton id="submitBtn" value="Login"
                    action="#{identity.login()}" />
            </div>

        </h:form>

and here is my relevant part of component.xml

<!-- USER AND ROLE -->
<security:jpa-identity-store role-class="com.galaksiya.kobar.entity.Role"
    user-class="com.galaksiya.kobar.entity.User" />
<!-- IDENTITY STORE AND ROLE STORE -->
<security:identity-manager identity-store="#{jpaIdentityStore}"
    role-identity-store="#{jpaIdentityStore}" />

I annotated Role and User classes as documentated 开发者_运维技巧here. But i don't know why my login is failing.

Any help would be appreciated. Thanks.

0

精彩评论

暂无评论...
验证码 换一张
取 消