From 803ff635e8fc8705378d197649b15da6ff58857f Mon Sep 17 00:00:00 2001 From: Andrei Rebegea Date: Thu, 15 Jun 2017 11:06:35 +0000 Subject: [PATCH] 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 --- .../auth/BaseSSOAuthenticationFilter.java | 25 ++++++++++++++++++- .../auth/KerberosAuthenticationFilter.java | 8 +++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java b/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java index 60d438231a..3a06c7c4d4 100644 --- a/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java +++ b/source/java/org/alfresco/repo/webdav/auth/BaseSSOAuthenticationFilter.java @@ -85,6 +85,29 @@ public abstract class BaseSSOAuthenticationFilter extends BaseAuthenticationFilt 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 */ @@ -576,7 +599,7 @@ public abstract class BaseSSOAuthenticationFilter extends BaseAuthenticationFilt final PrintWriter out = resp.getWriter(); out.println(""); out.println(""); out.println("

Please "); // Remove the auto refresh to avoid refresh loop, MNT-16931 // out.println(""); - out.println("

Please log in.

"); + out.println("

Please log in.

"); out.println(""); out.close(); }