mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged 5.2.N (5.2.2) to HEAD (5.2)
136663 amukha: MNT-17850 Add configurable login page link to auth response page The new configuration property is giving an ability to configure a link to custom login page in Alfresco web app which is displayed on the page after failed auth: kerberos.authentication.sso.login.page.link git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@137494 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -85,6 +85,29 @@ public abstract class BaseSSOAuthenticationFilter extends BaseAuthenticationFilt
|
|||||||
|
|
||||||
protected static final String MIME_HTML_TEXT = "text/html";
|
protected static final String MIME_HTML_TEXT = "text/html";
|
||||||
|
|
||||||
|
protected String loginPageLink;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return login page link, which is send back to the client if the login fails in the filter.
|
||||||
|
* Override to change the default behaviour.
|
||||||
|
*/
|
||||||
|
public String getLoginPageLink()
|
||||||
|
{
|
||||||
|
if (loginPageLink == null || loginPageLink.isEmpty())
|
||||||
|
{
|
||||||
|
return "/faces" + getLoginPage();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return loginPageLink;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoginPageLink(String loginPageLink)
|
||||||
|
{
|
||||||
|
this.loginPageLink = loginPageLink;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param serverConfiguration the serverConfiguration to set
|
* @param serverConfiguration the serverConfiguration to set
|
||||||
*/
|
*/
|
||||||
@@ -576,7 +599,7 @@ public abstract class BaseSSOAuthenticationFilter extends BaseAuthenticationFilt
|
|||||||
final PrintWriter out = resp.getWriter();
|
final PrintWriter out = resp.getWriter();
|
||||||
out.println("<html><head>");
|
out.println("<html><head>");
|
||||||
out.println("<meta http-equiv=\"Refresh\" content=\"0; url=" +
|
out.println("<meta http-equiv=\"Refresh\" content=\"0; url=" +
|
||||||
req.getContextPath() + "/faces" + getLoginPage() +
|
req.getContextPath() + getLoginPageLink() +
|
||||||
"\">");
|
"\">");
|
||||||
out.println("</head><body><p>Please <a href=\"" +
|
out.println("</head><body><p>Please <a href=\"" +
|
||||||
req.getContextPath() + "/faces" + getLoginPage() +
|
req.getContextPath() + "/faces" + getLoginPage() +
|
||||||
|
@@ -47,6 +47,12 @@ public class KerberosAuthenticationFilter extends BaseKerberosAuthenticationFilt
|
|||||||
// Debug logging
|
// Debug logging
|
||||||
private static Log logger = LogFactory.getLog(KerberosAuthenticationFilter.class);
|
private static Log logger = LogFactory.getLog(KerberosAuthenticationFilter.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLoginPageLink()
|
||||||
|
{
|
||||||
|
return loginPageLink;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.alfresco.repo.webdav.auth.BaseSSOAuthenticationFilter#onValidateFailed(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.http.HttpSession)
|
* @see org.alfresco.repo.webdav.auth.BaseSSOAuthenticationFilter#onValidateFailed(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, javax.servlet.http.HttpSession)
|
||||||
*/
|
*/
|
||||||
@@ -92,7 +98,7 @@ public class KerberosAuthenticationFilter extends BaseKerberosAuthenticationFilt
|
|||||||
out.println("<html><head>");
|
out.println("<html><head>");
|
||||||
// Remove the auto refresh to avoid refresh loop, MNT-16931
|
// Remove the auto refresh to avoid refresh loop, MNT-16931
|
||||||
// out.println("<meta http-equiv=\"Refresh\" content=\"0; url=" + req.getContextPath() + "/webdav\">");
|
// out.println("<meta http-equiv=\"Refresh\" content=\"0; url=" + req.getContextPath() + "/webdav\">");
|
||||||
out.println("</head><body><p>Please <a href=\"" + req.getContextPath() + "/webdav\">log in</a>.</p>");
|
out.println("</head><body><p>Please <a href=\"" + req.getContextPath() + getLoginPageLink() +"\">log in</a>.</p>");
|
||||||
out.println("</body></html>");
|
out.println("</body></html>");
|
||||||
out.close();
|
out.close();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user