[jboss-user] [JBoss Portal] - HTTP Status 500 - No authenticated user while accessing /por

mabimal do-not-reply at jboss.com
Tue May 12 07:21:15 EDT 2009


Hello All,

I have pointed portal's db to oracle.I am trying to point my own DB just for login credentials. and for it i created 3 tables in my DB. I have not used encryption for password in DB.

The changes i made in jboss portal are 

login-config.xml
<login-module code = "org.jboss.portal.identity.auth.DBIdentityLoginModule" flag="sufficient">
  |         <module-option name="dsJndiName">java:/HEUSERDS</module-option>
  |         <module-option name="principalsQuery">SELECT user_password FROM portal_users WHERE user_uname=?</module-option>
  |         <module-option name="rolesQuery">SELECT portal_roles.role_name, 'Roles' FROM  portal_roles_membership INNER JOIN portal_roles ON portal_roles_membership.role_rid = portal_roles.role_rid INNER JOIN portal_users ON portal_roles_membership.user_uid = portal_users.user_uid WHERE portal_users.user_uname=?</module-option>
  |         <module-option name="additionalRole">Authenticated</module-option>
  |      </login-module>
  |          <login-module code="org.jboss.security.ClientLoginModule" flag="required"></login-module>
inside authentication tag.

The dsJndiName here used is to point my DB(Just for login).

i have not changed 
<resource-ref>
  |       <res-ref-name>jdbc/PortalDS</res-ref-name>
  |       <jndi-name>java:PortalDS</jndi-name>
  |    </resource-ref>
in jboss-web.xml of portal-server.war/WEB-INF

Should i mention jdbc/HEUSERDS here?

I have added <servlet>  
  |     	<servlet-name>LoginServlet</servlet-name>  
  |     	<servlet-class>org.bimal.tryout.LoginServlet</servlet-class>  
  | 	</servlet>  
  |   
  | 	<servlet-mapping>  
  |     	<servlet-name>LoginServlet</servlet-name>  
  |     	<url-pattern>/LoginServlet</url-pattern>  
  | 	</servlet-mapping>  
in web.xml of portal-server.war/WEB-INF

and this LoginServlet have been used as the action of login.jsp of portal-server

The code of  LoginServlet.java is as follows

protected void doPost(HttpServletRequest req, HttpServletResponse resp)
  | 			throws ServletException, IOException {
  | 		String user = req.getParameter("j_username");
  | 		String pass = req.getParameter("j_password");
  | 		String baseURL = "/portal/auth/dashboard";
  | 		
  | 		String referer = null;
  |    	 System.out.println(user);
  | 
  | 		WebAuthentication webA = new WebAuthentication();
  | 
  | 		 if(webA.login(user, pass)){
  | 			 System.out.println(user);
  | 			System.out.println(pass);
  | 
  | 			System.out.println("Logged in successfully");
  | 			System.out.println(req.getRemoteUser() +"\n"+ req.getUserPrincipal());
  | 		    referer = req.getHeader("Referer");
  | 			System.out.println(referer);
  | 			System.out.println(req.getRemoteUser());
  | 			System.out.println(req.getUserPrincipal());
  | 			resp.sendRedirect(baseURL);
  | 		} else {
  | 			referer = req.getHeader("Referer");
  | 			System.out.println(referer);
  | 			resp.sendRedirect(baseURL);
  | 		} 
  |          } 

Here in this code, req.getRemoteUser() and req.getUserPrincipal() are not null and they are returning user. but still i am getting

HTTP Status 500 - No authenticated user while accessing /portal/auth/dashboard when LoginServlet redirects to /portal/auth/dashboard.

If i point to /portal it shows user logged in, but dashboard link is not present. 
If the user is with admin role then Admin links appear and it's fully functional too.

But what is going on with Dashboard.
The Dashboard, Configure Dashboard links dont appear. 

One thing to mention is I am using JBoss Portal 2.7.2 bundled edition, which has JBoss AS 4.2.3.

What might be the solution of it.






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

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



More information about the jboss-user mailing list