mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Refactoring webscript authentication to deal with redirecting etc. when no valid authentication for the script is available
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5718 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -73,7 +73,7 @@ public class WebClientPortletAuthenticator implements WebScriptPortletAuthentica
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.scripts.portlet.WebScriptPortletAuthenticator#authenticate(org.alfresco.web.scripts.WebScriptDescription.RequiredAuthentication, boolean, javax.portlet.RenderRequest, javax.portlet.RenderResponse)
|
||||
*/
|
||||
public void authenticate(RequiredAuthentication required, boolean isGuest, RenderRequest req, RenderResponse res)
|
||||
public boolean authenticate(RequiredAuthentication required, boolean isGuest, RenderRequest req, RenderResponse res)
|
||||
{
|
||||
PortletSession session = req.getPortletSession();
|
||||
String portalUser = req.getRemoteUser();
|
||||
@@ -115,6 +115,8 @@ public class WebClientPortletAuthenticator implements WebScriptPortletAuthentica
|
||||
removeSessionInvalidated(session);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -254,9 +254,9 @@ public class WebScriptPortlet implements Portlet
|
||||
* @see org.alfresco.web.scripts.WebScriptRuntime#authenticate(org.alfresco.web.scripts.WebScriptDescription.RequiredAuthentication, boolean)
|
||||
*/
|
||||
@Override
|
||||
protected void authenticate(RequiredAuthentication required, boolean isGuest)
|
||||
protected boolean authenticate(RequiredAuthentication required, boolean isGuest)
|
||||
{
|
||||
authenticator.authenticate(required, isGuest, req, res);
|
||||
return authenticator.authenticate(required, isGuest, req, res);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@@ -29,7 +29,6 @@ import javax.portlet.RenderResponse;
|
||||
|
||||
import org.alfresco.web.scripts.WebScriptDescription.RequiredAuthentication;
|
||||
|
||||
|
||||
/**
|
||||
* Web Script Authenticator for the JSR-168 environment
|
||||
*
|
||||
@@ -37,15 +36,15 @@ import org.alfresco.web.scripts.WebScriptDescription.RequiredAuthentication;
|
||||
*/
|
||||
public interface WebScriptPortletAuthenticator
|
||||
{
|
||||
|
||||
/**
|
||||
* Authenticate Web Script execution
|
||||
*
|
||||
* @param required required level of authentication
|
||||
* @param isGuest is Guest accessing the web script
|
||||
* @param req portlet render request
|
||||
* @param res portlet render response
|
||||
*/
|
||||
public void authenticate(RequiredAuthentication required, boolean isGuest, RenderRequest req, RenderResponse res);
|
||||
|
||||
/**
|
||||
* Authenticate Web Script execution
|
||||
*
|
||||
* @param required required level of authentication
|
||||
* @param isGuest is Guest accessing the web script
|
||||
* @param req portlet render request
|
||||
* @param res portlet render response
|
||||
*
|
||||
* @return true if authorised, false otherwise
|
||||
*/
|
||||
public boolean authenticate(RequiredAuthentication required, boolean isGuest, RenderRequest req, RenderResponse res);
|
||||
}
|
||||
|
Reference in New Issue
Block a user