Hi everyone
I have had a Zimbra server working great and authenticating via CAS. We are looking at testing a new server that authenticates by CAS but checks the CAS_FILTER_USER against a MySql database on another server where it retrieves the appropriate account name. The idea is, we want multiple users to access an account with their own CAS credentials.
I have added the following to the previously working preauth.jsp:
The following appears in the /opt/zimbra/log/mailbox.log:Code://Get CAS User from server and split username to only CWID String casUser = (String) session.getAttribute(edu.yale.its.tp.cas.client.filter.CASFilter.CAS_FILTER_USER); String[]cwid = casUser.split("@"); out.println(cwid[0]); //START MYSQL CONNECTION AND QUERY String DRIVER = "com.mysql.jdbc.Driver"; Class.forName(DRIVER).newInstance(); Connection con=null; ResultSet rst=null; Statement stmt=null; String url="jdbc:mysql://test.other.server:3306/test?user=mickey&password=mouse"; con=DriverManager.getConnection(url); stmt=con.createStatement(); rst=stmt.executeQuery("select cwid from members WHERE cwid='cwid[0]'"); while(rst.next()) { String cwid2 = rst.getString(0); }//end of while rst.close(); stmt.close(); con.close(); String redirect = generateRedirect(request,cwid2+"@test.zimbra.server"); out.println(redirect); response.sendRedirect(redirect);
Any help in the right direction would be greatly appreciated.Code:2009-10-13 14:47:24,936 WARN [btpool0-9] [] log - /zimbra/preauth.jsp org.apache.jasper.JasperException: PWC6033: Unable to compile class for JSP PWC6197: An error occurred at line: 90 in the jsp file: /preauth.jsp PWC6199: Generated servlet error: cwid2 cannot be resolved
~Tim


LinkBack URL
About LinkBacks


