Login issue with DatabaseServerLoginModule in JBoss 6

前端 未结 1 1055
刺人心
刺人心 2021-01-25 22:45

I get a ServeletException: Failed to authenticate a principal when I attempt to login with the DatabaseServerLoginModule. I\'m guessing the issue is either how

相关标签:
1条回答
  • 2021-01-25 23:15

    I was able to get help with this on the jboss as forums. My solution was to revise the markup of the rolesQuery from:

    <module-option name="rolesQuery" 
        value="SELECT groupid, 'Roles' FROM grouptable WHERE username=?" />
    

    to this:

    <module-option name="rolesQuery">
       SELECT groupid, 'Roles' FROM grouptable WHERE username=?
    </module-option>
    

    I also had to change the encoding style to HEX. Here is my working login-config.xml.

    <application-policy name="Avengers">
        <authentication>
           <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
              <module-option name="dsJndiName">java:/jdbc/thor_ds</module-option>
              <module-option name="principalsQuery">SELECT password FROM usertable WHERE username = ?</module-option>
              <module-option name="rolesQuery">SELECT groupid, 'Roles' FROM grouptable WHERE username=?</module-option>
              <module-option name="hashAlgorithm">MD5</module-option>
              <module-option name="hashEncoding">HEX</module-option>
              <!--<module-option name="hashEncoding">base64</module-option>-->
           </login-module>
        </authentication>
     </application-policy>
    
    0 讨论(0)
提交回复
热议问题