1 Reply Latest reply: Dec 6, 2012 4:38 AM by 859967 RSS

    jdbc realm failed to work

    859967
      Hi,

      I am trying to create JDBC realm mentioned this link:

      [http://jugojava.blogspot.com/2011/02/jdbc-security-realm-with-glassfish-and.html]

      but i always have LoginException: Login failed: No LoginModules configured.

      could you tell me how to figure out the source of the problem or if you have faced the same issue?

      I have jdbc6.jar in "lib" folder under my domain, and i am using oracle database instead of mysql.

      this is my web.xml
        <login-config>
              <auth-method>FORM</auth-method>
              <realm-name>jdbcOracle</realm-name>
              <form-login-config>
                  <form-login-page>/login.xhtml</form-login-page>
                  <form-error-page>/error.xhtml</form-error-page>
              </form-login-config>
          </login-config>
          
           <security-constraint>
              <display-name>Constraint1</display-name>
              <web-resource-collection>
                  <web-resource-name>wrcoll</web-resource-name>
                  <description/>
                  <url-pattern>/*</url-pattern>
              </web-resource-collection>
              <auth-constraint>
                  <description/>
                  <role-name>ADMIN</role-name>
                  <role-name>USER</role-name>
              </auth-constraint>
          </security-constraint>
      and sun-web.xml
           <security-role-mapping>
              <role-name>ADMIN</role-name>
              <group-name>ADMIN</group-name>
          </security-role-mapping>
        
         <security-role-mapping>
          <role-name>USER</role-name>
          <group-name>USER</group-name>
         </security-role-mapping>
      thanks,

      Edited by: CardM on Dec 6, 2012 12:21 AM
        • 1. Re: jdbc realm failed to work
          859967
          oh nooo,, this is Glassfish question, anyway i have found the problem. It is because in the setting of user and group table name, i have to set it value as fully qualified name.

          Here is the clue.

          [http://stackoverflow.com/questions/12067410/glassfish-3-1-2-jdbcrealm-configuration]