mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-17 14:21:39 +00:00
PMD Issue
This commit is contained in:
@@ -349,14 +349,14 @@ public class RemoteUserAuthenticatorFactory extends BasicHttpAuthenticatorFactor
|
|||||||
|
|
||||||
private boolean shouldUseTimeoutForAdminAccessingAdminConsole(RequiredAuthentication required, boolean isGuest)
|
private boolean shouldUseTimeoutForAdminAccessingAdminConsole(RequiredAuthentication required, boolean isGuest)
|
||||||
{
|
{
|
||||||
boolean useTimeoutForAdminAccessingAdminConsole = RequiredAuthentication.admin.equals(required) && !isGuest &&
|
boolean adminConsoleTimeout = RequiredAuthentication.admin.equals(required) && !isGuest &&
|
||||||
servletReq.getServiceMatch() != null && isAdminConsoleWebScript(servletReq.getServiceMatch().getWebScript());
|
servletReq.getServiceMatch() != null && isAdminConsoleWebScript(servletReq.getServiceMatch().getWebScript());
|
||||||
|
|
||||||
if (LOGGER.isTraceEnabled())
|
if (LOGGER.isTraceEnabled())
|
||||||
{
|
{
|
||||||
LOGGER.trace("Should ensure that the admins can login with basic auth: " + useTimeoutForAdminAccessingAdminConsole);
|
LOGGER.trace("Should ensure that the admins can login with basic auth: " + adminConsoleTimeout);
|
||||||
}
|
}
|
||||||
return useTimeoutForAdminAccessingAdminConsole;
|
return adminConsoleTimeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean shouldUseTimeoutForAdminAccessingWebScriptHome(RequiredAuthentication required, boolean isGuest)
|
private boolean shouldUseTimeoutForAdminAccessingWebScriptHome(RequiredAuthentication required, boolean isGuest)
|
||||||
|
@@ -63,8 +63,6 @@ public abstract class AbstractIdentityServiceAuthenticator
|
|||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractIdentityServiceAuthenticator.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractIdentityServiceAuthenticator.class);
|
||||||
|
|
||||||
protected abstract boolean isWebScriptHome();
|
|
||||||
|
|
||||||
protected IdentityServiceConfig identityServiceConfig;
|
protected IdentityServiceConfig identityServiceConfig;
|
||||||
protected IdentityServiceFacade identityServiceFacade;
|
protected IdentityServiceFacade identityServiceFacade;
|
||||||
protected AdminAuthenticationCookiesService cookiesService;
|
protected AdminAuthenticationCookiesService cookiesService;
|
||||||
@@ -74,6 +72,8 @@ public abstract class AbstractIdentityServiceAuthenticator
|
|||||||
public static final String ALFRESCO_REFRESH_TOKEN = "ALFRESCO_REFRESH_TOKEN";
|
public static final String ALFRESCO_REFRESH_TOKEN = "ALFRESCO_REFRESH_TOKEN";
|
||||||
public static final String ALFRESCO_TOKEN_EXPIRATION = "ALFRESCO_TOKEN_EXPIRATION";
|
public static final String ALFRESCO_TOKEN_EXPIRATION = "ALFRESCO_TOKEN_EXPIRATION";
|
||||||
|
|
||||||
|
protected abstract boolean isWebScriptHome();
|
||||||
|
|
||||||
public String resolveUser(HttpServletRequest request, HttpServletResponse response)
|
public String resolveUser(HttpServletRequest request, HttpServletResponse response)
|
||||||
{
|
{
|
||||||
String username = remoteUserMapper.getRemoteUser(request);
|
String username = remoteUserMapper.getRemoteUser(request);
|
||||||
@@ -224,8 +224,11 @@ public abstract class AbstractIdentityServiceAuthenticator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
if (LOGGER.isDebugEnabled())
|
||||||
{
|
{
|
||||||
LOGGER.debug("Token refresh failed: {}", e.getMessage());
|
LOGGER.debug("Token refresh failed: {}", e.getMessage());
|
||||||
|
}
|
||||||
bearerToken = null;
|
bearerToken = null;
|
||||||
resetCookies(response);
|
resetCookies(response);
|
||||||
}
|
}
|
||||||
|
@@ -102,6 +102,7 @@ public class IdentityServiceWebScriptHomeAuthenticator extends AbstractIdentityS
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String getRedirectUri(String requestURL)
|
protected String getRedirectUri(String requestURL)
|
||||||
{
|
{
|
||||||
return getWebScriptHomeRedirectUri(requestURL);
|
return getWebScriptHomeRedirectUri(requestURL);
|
||||||
|
Reference in New Issue
Block a user