form based login in jboss using login-config not working

Discussion in 'Java' started by manu, Jul 20, 2008.

  1. manu

    manu Guest

    jboss-web.xml contains
    <jboss-web>
    <security-domain>java:/jaas/wizomLogin</security-domain>
    <context-root>/test</context-root>
    </jboss-web>

    login.html
    <html>
    <body>
    <h1>Please Authenticate</h1>
    <form method="POST" action="j_security_check">
    User Name: <input type="text" name="j_username" /><br />
    Password: <input type="password" name="j_password" /><br />
    <input type="submit" value="Login" />
    </form>
    </body>
    </html>
    web.xml contains
    <web-app>
    <description>A test app for security</description>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>All resources</web-resource-name>
    <description>Protects all resources</description>
    <url-pattern>/*</url-pattern>
    <http-method>GET</http-method>
    <http-method>POST</http-method>
    </web-resource-collection>
    <auth-constraint>
    <role-name>WebAppUser</role-name>
    </auth-constraint>
    </security-constraint>

    <security-role>
    <role-name>WebAppUser</role-name>
    </security-role>

    <login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
    <form-login-page>/login.html</form-login-page>
    <form-error-page>/error.html</form-error-page>
    </form-login-config>
    </login-config>

    </web-app>
    login-config.xml conatins
    <application-policy name = "wizomLogin">
    <authentication>
    <login-module code =
    "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag =
    "required">
    <module-option name = "dsJndiName">java:mySqlWizom</module-option>
    <module-option name = "principalsQuery">Select password from userInfo
    where userInfo.username=?</module-option>
    <module-option name = "rolesQuery">Select role,'Roles' from wizomRole
    where wizomRole.username=?</module-option>
    <module-option name="unauthenticatedIdentity">guest</module-option>
    </login-module>
    </authentication>
    </application-policy>
    database conatins tables
    userInfo with username and password
    wizom wizom
    wizomRole with username and role
    wizom WebUserApp

    still login does not work
    instead if i used application policy that reads username password
    roles from file that will work.

    please post me the solution.
     
    manu, Jul 20, 2008
    #1
    1. Advertising

  2. manu

    Evans Guest

    Pay me loads of money and I will send you the solution. Otherwise,
    piss off and never post here again!

    --
    Evans
    http://www.jroller.com/evans
     
    Evans, Jul 20, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrea
    Replies:
    4
    Views:
    11,831
    Andrea
    Nov 30, 2005
  2. han
    Replies:
    0
    Views:
    497
  3. Jubz
    Replies:
    0
    Views:
    2,338
  4. CSharpner
    Replies:
    0
    Views:
    1,094
    CSharpner
    Apr 9, 2007
  5. LprzemekL
    Replies:
    0
    Views:
    549
    LprzemekL
    Apr 10, 2008
Loading...

Share This Page