9 Replies Latest reply on Aug 1, 2007 1:12 PM by Gerson Samaniego

    Portal Login

    Jeroen Koek Newbie


      I'm using a JSPPortlet with contains a form with the login credentials.
      This portlet runs on a portal page on a different portal then the default portal.
      /portal/portal/MyPortal/Home for instance

      When I submit the form the portal/Tomcat complains with the following error;
      HTTP Status 400 - Invalid direct reference to form login page

      The reason why I want to use this way of login in, is that I don't want to change another package in the deployment set (web.xml in portal-server.war).
      Because my deployment must be able to run on different portals or integrate with my customers portal.
      Where my customer has it's own login modules.

      I can check with the JSPPortlet if a user is logged on, if that is the case I don't have to show the login dialog but can so a welcome message.

      Underneath the jsp content of the jsp file I'm using to log;

      <div id="login-container" style="width:250px" >
      <form method="POST" action="<%= response.encodeURL("/portal/j_security_check") %>" id="loginForm" >
      <label for="username">Username:</label><input type="text" name="j_username" id="username" value=""/><br>
      <label for="password">Password:</label><input type="password" name="j_password" id="password" value=""/><br>
      <input type="submit" id="loginButton" name="login" value="Login"/>

      Does anyone have a clue what I'm doing wrong?

      Thanks in advance,


        • 1. Re: Portal Login
          Sohil Shah Master


          The Tomcat Form Authenticator uses the Login Page location configured during its configuration in the web.xml. Thats why it looks like Tomcat is complaining.

          If you want to integrate/swap different LoginModule implementations, you should be able to do it in the jboss-portal.sar/conf/login-config.xml


          • 2. Re: Portal Login
            Nguyen Nhat Nam Newbie

            Hi all,
            I'm very new to JbossPortal. I've deployed jboss-portal.sar and installed MySQL database named "jbossportal". Now i can run the homepage of the Portal but i couldn't login. It reported "Invalid user login". I checked there's no user in table "jbp_users".
            Could u tell me where to check the user existed? The default user "admin" was not accepted.


            • 4. Re: Portal Login
              Jeroen Koek Newbie

              Sorry for my late response.

              But I don't want to inject a different LoginModule.

              I want to use the default LoginModule.

              My deployment may not be portal specific.
              So I want to call the /portal/j_security_check from within my own portlet.


              • 5. Re: Portal Login
                Peter Halverson Newbie


                I want to call the /portal/j_security_check from within my own portlet.

                You can't. "j_security_check" is not a real URL, but a magic bullet which only the underlying web app server (e.g. Tomcat) is allowed to fire or catch, part of the J2EE form-login spec. As far as I know the only way to initiate a forms-based login is to force a redirect to a protected URL, triggering the app server's login protocol implicitly. I'd settle for a proprietary hook into tomcat just to do it manually, but I've not found such a call.


                • 6. Re: Portal Login
                  Fred Grott Newbie


                  Originally I was using MySQL5 mis confugred ie was not in strict mode however my data soruce was not correct and thus got could not create tables first time..

                  So I than corrrect the datasource and restarted with could not log in as user or admin..

                  SO I than stopped server and deleted default/tmp, default,data, default/log, and default work with the same results of not being able to log in with user/user or admin/admin..

                  I did a Mysqladmin check and yes the user table is at zero..

                  My solution is to create a new db and pint my JBossPortal bundled install to that db and thus problem solved..

                  Thus I guess the answer to org thread should be if originally deployed wrong using MYSQL5 ie the my.ini or the datasource was incorrect than you need to create a new db or re-create org db and than restart server to fix admin/admin user/user login problems.

                  • 7. Re: Portal Login
                    damchy Newbie

                    I have the same problem as jkoek and I have one question!?

                    Is it possible to make own login portlet on the same way as originally login.jsp?

                    I try this http://wiki.jboss.org/wiki/Wiki.jsp?page=PortletLogin , but POST
                    method doesn't work. No username and password are POSTED to originally login.jsp .Why?

                    Can somebody help me please, how to do own login portlet.

                    • 8. Re: Portal Login
                      damchy Newbie

                      Can somebody help me please?

                      • 9. Re: Portal Login
                        Gerson Samaniego Newbie

                        hello damchy I have the same problem as you in jboss portal 2.6. It seems that session is erased before arriving at login.jsp.

                        You could solve the problem?


                        Gerson Samaniego