[jboss-user] [Beginners Corner] - Re: Setting up database authentication in JBoss using JAAS

safwateleish do-not-reply at jboss.com
Wed Mar 7 15:56:39 EST 2007


I have the same problem. authentication fails and i am being redirected to the error page without any log indicating the error that happened. My configurations are as follows:


I added the following entry to the login-config.xml

    <application-policy name = "jbossdatabaseBilling">
       
          <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
             flag = "required">
             <module-option name = "unauthenticatedIdentity">guest</module-option>
             <module-option name = "dsJndiName">java:/myDS</module-option>
             <module-option name = "principalsQuery">SELECT PASSWORD passwd FROM USERS WHERE USERNAME=?</module-option>
             <module-option name = "rolesQuery">SELECT ROLENAME  userRoles, 'Roles' FROM DUMMYROLES WHERE USERNAME =?</module-option>
          </login-module>
       
    </application-policy>


By the way my database is oracle.  and i jave defined myDS in oracle-ds.xml in the deploy directory of my server.

I have the jboss-web.xml in the same directory of the web.xml of my web application. It has the following entry

<security-domain>java:/jaas/jbossdatabaseBilling</security-domain>


finally in the web.xml file i added the following sections

    <security-role>
        <role-name>users</role-name>
    </security-role>


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



    <security-constraint>
        <web-resource-collection>
            <web-resource-name>whatever</web-resource-name>
            <url-pattern>/*</url-pattern>
            <http-method>POST</http-method>
            <http-method>GET</http-method>
        </web-resource-collection>
        <auth-constraint>
            <role-name>upgradebundle</role-name>
        </auth-constraint>
    </security-constraint>
    <security-constraint>


----- 

I am still being redirected to the error page. Any hint ? Please i need help

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025954#4025954

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025954



More information about the jboss-user mailing list