9 Replies Latest reply on Apr 6, 2002 11:59 PM by Andrej

    Form based login

    Maurice Mills Newbie

      How do I use the form based login approach? In WebLogic, I use:


      <input name=j_username><input name=j_password>


      This calls the authentication process automatically. Does JBoss have the same functionality? When I try this with JBoss, I get a (404) "//j_securitycheck" not found.

      Any suggestions?

      Thanks

        • 1. Re: Form based login
          Nathaniel Auvil Newbie


          the action should be: j_security_check


          > How do I use the form based login approach? In
          > WebLogic, I use:
          >
          >
          > <input name=j_username><input name=j_password>
          >
          >
          > This calls the authentication process automatically.
          > Does JBoss have the same functionality? When I try
          > this with JBoss, I get a (404)
          > "//j_securitycheck" not found.
          >
          > Any suggestions?
          >
          > Thanks

          • 2. Re: Form based login
            Maurice Mills Newbie

            I tried that also, and I get the same thing.

            I am using the downloaded JBoss 2.4.1/Tomcat 3.2.3 package. Could it be something with my configuration?

            • 3. Re: Form based login
              Joel Shellman Newbie

              I don't know about the tomcat package, but I noticed that for the version of Jetty I'm using, I had to make sure the j_security_check was posting to somewhere inside the restricted area: action="restricted/j_security_check". Might have been fixed in a more recent build, but maybe tomcat has a similar bug?

              Either way, are you sure you are setting up your web.xml and your security domain properly in the xml config files? If not, than 404 is probably what you'd be getting.

              • 4. Re: Form based login
                Paul Austin Newbie

                This was a bug in the RC9 and previous versions and I think they have fixed it. I'm going to test the new version they just released to see if it works.

                Paul

                • 5. Re: Form based login
                  Nathaniel Auvil Newbie

                  i submit to j_security_check and it works. Are you trying to bring the login page up by yourself or is it coming up because you tried to access a secured resource? I am not sure if it will work if you bring it up manually.

                  • 6. Re: Form based login
                    Maurice Mills Newbie

                    I think I am displaying it manually, however aven if I change the web.xml file to use form based login, it still shows a login dialog and not my login.jsp.

                    • 7. Re: Form based login
                      Nathaniel Auvil Newbie


                      this is part of a web.xml that will bring up whatever web page you put in for the login...

                      
                       <login-config>
                       <auth-method>FORM</auth-method>
                       <realm-name>JAAS Tutorial Servlets</realm-name>
                       <form-login-config>
                       <form-login-page>/LoginForm.html</form-login-page>
                       <form-error-page>/LoginError.html</form-error-page>
                       </form-login-config>
                       </login-config>
                      
                      


                      • 8. Re: Form based login
                        paja Newbie

                        I am using a simple login.jsp script:



                        <form method="POST" action='<%= response.encodeURL("j_security_check") %>' >
                        Username:
                        Password:





                        It works perfectly, but if I try include some other file or for example some css styles, then after authentification the page is redirected on the css style.
                        I need to redirect to index.jsp. Could you help me?

                        This works bad:






                        <form method="POST" action='<%= response.encodeURL("j_security_check") %>' >
                        Username:
                        Password:





                        I am redirected to http://localhost:8080/resources.styly.css

                        do somebody knows why?

                        • 9. Re: Form based login
                          Andrej Newbie

                          Hi,

                          I assume you're using Netscape as your browser. It that's the case, then it's probably because it can't find your CSS... you probably have to add your application context such as

                          <link href="myapp/resources/styly.css" rel="StyleSheet" type="text/css">

                          Netscape is much more picky than IE...

                          HTH

                          Andrej