This commit is contained in:
Massimiliano Assante 2016-11-15 16:42:45 +00:00
parent dad4c8beb0
commit 7dca141d2f
1 changed files with 15 additions and 14 deletions

View File

@ -30,7 +30,7 @@ import com.liferay.portal.service.UserLocalServiceUtil;
public class SmartGearsPortalValve extends ValveBase {
private static final Logger _log = LoggerFactory.getLogger(SmartGearsPortalValve.class);
private final static String DEFAULT_ROLE = "OrganizationMember";
private final static String LIFERAY_POLLER_CONTEXT = "poller/receive";
@Override
@ -41,8 +41,8 @@ public class SmartGearsPortalValve extends ValveBase {
//_log.trace("SmartGearsPortalValve SecurityTokenProvider and AuthorizationProvider reset OK");
if (req instanceof HttpServletRequest) {
HttpServletRequest request = (HttpServletRequest) req;
if (!req.getRequestURL().toString().endsWith(LIFERAY_POLLER_CONTEXT)) { //avoid calling gCube auth service for liferay internal poller
PortalContext context = PortalContext.getConfiguration();
String scope = context.getCurrentScope(request);
String username = getCurrentUsername(request);
if (scope != null && username != null) {
@ -56,6 +56,7 @@ public class SmartGearsPortalValve extends ValveBase {
//_log.trace("Security token set OK for " + username + " in scope " + scope);
}
}
}
getNext().invoke(req, resp);
}