Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Fix kerberos from-based authentication.
Browse files Browse the repository at this point in the history
Using a servlet to generate the login form was causing the NegotiationAuthenticator valve to return the wrong response code, halting the SPNego process and preventing ticket based authentication (if available) from taking effect.

Replaced the servlet with a jsp file which doesn't have the same problem. Static files work too (.html) but there is a need to dynamically generate the redirection url.
  • Loading branch information
Carlos A. Munoz committed Nov 12, 2013
1 parent c4152ef commit 2e954a8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 78 deletions.

This file was deleted.

15 changes: 3 additions & 12 deletions zanata-war/src/main/webapp-jboss/WEB-INF/web.xml
Expand Up @@ -20,8 +20,9 @@
<login-config>
<auth-method>SPNEGO</auth-method>
<form-login-config>
<form-login-page>/account/kloginform</form-login-page>
<form-error-page>/sdsdf</form-error-page>
<form-login-page>/account/kloginform.jsp</form-login-page>
<!-- Error page not needed since the login form takes over -->
<form-error-page>/</form-error-page>
</form-login-config>
</login-config>
<security-role>
Expand Down Expand Up @@ -192,16 +193,6 @@
<!-- <url-pattern>/seam/resource/restv1/*</url-pattern> -->
<!-- </servlet-mapping> -->

<servlet>
<servlet-name>KerberosLoginFormServlet</servlet-name>
<servlet-class>org.zanata.servlet.KerberosLoginFormServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>KerberosLoginFormServlet</servlet-name>
<url-pattern>/account/kloginform</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>Seam Resource Servlet</servlet-name>
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
Expand Down
12 changes: 12 additions & 0 deletions zanata-war/src/main/webapp/account/kloginform.jsp
@@ -0,0 +1,12 @@
<%
String queryStr = request.getQueryString(); // keep the original request's
// query string
if (queryStr != null && !queryStr.isEmpty()) {
queryStr = "?" + queryStr;
}
%>
<html>
<head>
<meta http-equiv="refresh" content="0; url=sign_in<%=queryStr%>">
</head>
</html>

0 comments on commit 2e954a8

Please sign in to comment.