[jboss-user] [JBoss Portal] - Problems with DatabaseServerLoginModule

pranji do-not-reply at jboss.com
Wed Aug 8 08:32:22 EDT 2007


Hi

 I am trying to use the DatabaseServerLoginModule but am facing some problems. I have created a portal instance which has to be accessed after JAAS authentication.

In my .war file for my portal instance i have the following files
web.xml
anonymous wrote : 
  | 
  |       <servlet-name>PortalServletWithPathMapping</servlet-name>
  | 	  <servlet-class>org.mex.portlets.login.servlet.LoginServlet</servlet-class>
  |       <load-on-startup>1</load-on-startup>
  |       <security-role-ref>
  |         <role-name>Authenticated</role-name>
  |         <role-link>Authenticated</role-link>
  |       </security-role-ref>
  |    
  | 
  | 
  |    <!-- Provide access to authenticated users -->
  |    <servlet-mapping>
  |       <servlet-name>PortalServletWithPathMapping</servlet-name>
  |       <url-pattern>/authpublic/*</url-pattern>
  |    </servlet-mapping>
  | 
  |    <!-- Force the mapping of the jsp and images because of the default servlet replacement -->
  |    <servlet-mapping>
  |       <servlet-name>jsp</servlet-name>
  |       <url-pattern>/login.jsp</url-pattern>
  |    </servlet-mapping>
  |    <servlet-mapping>
  |       <servlet-name>jsp</servlet-name>
  |       <url-pattern>/error.jsp</url-pattern>
  |    </servlet-mapping>
  | 
  | <resource-ref>
  |       <res-ref-name>jdbc/PortalDS</res-ref-name>
  |       <res-type>javax.sql.DataSource</res-type>
  |       <res-auth>Container</res-auth>
  |       <res-sharing-scope>Shareable</res-sharing-scope>
  |    </resource-ref>
  | 
  |    <security-constraint>
  |       <web-resource-collection>
  |          <web-resource-name>Authenticated</web-resource-name>
  |          
  |          <url-pattern>/authpublic/*</url-pattern>
  |       </web-resource-collection>
  |       <auth-constraint>
  |          <role-name>Authenticated</role-name>
  |       </auth-constraint>
  |    </security-constraint>
  |    <login-config>
  |       <auth-method>FORM</auth-method>
  |       <realm-name>public</realm-name>
  |       <form-login-config>
  |          <form-login-page>/login.jsp</form-login-page>
  |          <form-error-page>/error.jsp</form-error-page>
  |       </form-login-config>
  |    </login-config>
  | 
  |    <security-role>
  |       <role-name>Authenticated</role-name>
  |    </security-role>
  | 

my jboss-web.xml 
anonymous wrote : <jboss-web>
  |    <security-domain>java:jaas/publicportal</security-domain>
  |    <context-root>/public</context-root>
  |    <resource-ref>
  |       <res-ref-name>jdbc/PortalDS</res-ref-name>
  |       <jndi-name>java:PortalDS</jndi-name>
  |    </resource-ref>
  | </jboss-web>
  | 

in the login-config inside portal.sar i have added this
anonymous wrote : 
  | <application-policy name = "publicportal">
  |        
  |           <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
  |              flag = "required">
  |              <module-option name = "unauthenticatedIdentity">guest</module-option>
  |              <module-option name = "dsJndiName">java:/PortalDS</module-option>
  |              <module-option name = "principalsQuery">SELECT PASSWD FROM JMS_USERS WHERE USERID=?</module-option>
  |              <module-option name = "rolesQuery">SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?</module-option>
  |           </login-module>
  |        
  |     </application-policy>
  | 

I have even enabled logging as per the secutiry FAQ but when i log in i see null on the error.jsp page with no logging messages 

Basically
anonymous wrote : request.getAttribute("org.jboss.portal.loginError")returns null and i am not able to login

Can anyone please help 




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

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



More information about the jboss-user mailing list