mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Temporary build fix. Lazy initialisation of authentication filter login page (because config service not bootstrapped at the time of authentication subsystem bootstrap). Will return with better fix.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13677 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -54,6 +54,7 @@ public class AuthenticationFilter implements DependencyInjectedFilter
|
||||
{
|
||||
|
||||
private String loginPage;
|
||||
private ConfigService configService;
|
||||
|
||||
/**
|
||||
* @param configService
|
||||
@@ -61,13 +62,22 @@ public class AuthenticationFilter implements DependencyInjectedFilter
|
||||
*/
|
||||
public void setConfigService(ConfigService configService)
|
||||
{
|
||||
ClientConfigElement clientConfig = (ClientConfigElement) configService.getGlobalConfig().getConfigElement(
|
||||
ClientConfigElement.CONFIG_ELEMENT_ID);
|
||||
|
||||
if (clientConfig != null)
|
||||
this.configService = configService;
|
||||
}
|
||||
|
||||
public synchronized String getLoginPage()
|
||||
{
|
||||
if (this.loginPage == null)
|
||||
{
|
||||
loginPage = clientConfig.getLoginPage();
|
||||
ClientConfigElement clientConfig = (ClientConfigElement) this.configService.getGlobalConfig()
|
||||
.getConfigElement(ClientConfigElement.CONFIG_ELEMENT_ID);
|
||||
|
||||
if (clientConfig != null)
|
||||
{
|
||||
this.loginPage = clientConfig.getLoginPage();
|
||||
}
|
||||
}
|
||||
return this.loginPage;
|
||||
}
|
||||
|
||||
public void doFilter(ServletContext context, ServletRequest req, ServletResponse res, FilterChain chain)
|
||||
@@ -77,7 +87,7 @@ public class AuthenticationFilter implements DependencyInjectedFilter
|
||||
HttpServletResponse httpRes = (HttpServletResponse) res;
|
||||
|
||||
// allow the login page to proceed
|
||||
if (!httpReq.getRequestURI().endsWith(this.loginPage))
|
||||
if (!httpReq.getRequestURI().endsWith(getLoginPage()))
|
||||
{
|
||||
AuthenticationStatus status = AuthenticationHelper.authenticate(context, httpReq, httpRes, false);
|
||||
|
||||
|
Reference in New Issue
Block a user