001
014
015 package com.liferay.portal.security.auth;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
019
020 import javax.servlet.http.HttpServletRequest;
021
022
025 public class AuthTokenUtil {
026
027 public static void check(HttpServletRequest request)
028 throws PortalException {
029
030 getAuthToken().check(request);
031 }
032
033 public static AuthToken getAuthToken() {
034 PortalRuntimePermission.checkGetBeanProperty(AuthTokenUtil.class);
035
036 return _authToken;
037 }
038
039 public static String getToken(HttpServletRequest request) {
040 return getAuthToken().getToken(request);
041 }
042
043 public static String getToken(
044 HttpServletRequest request, long plid, String portletId) {
045
046 return getAuthToken().getToken(request, plid, portletId);
047 }
048
049 public static boolean isValidPortletInvocationToken(
050 HttpServletRequest request, long plid, String portletId,
051 String strutsAction, String tokenValue) {
052
053 return getAuthToken().isValidPortletInvocationToken(
054 request, plid, portletId, strutsAction, tokenValue);
055 }
056
057 public void setAuthToken(AuthToken authToken) {
058 PortalRuntimePermission.checkSetBeanProperty(getClass());
059
060 _authToken = authToken;
061 }
062
063 private static AuthToken _authToken;
064
065 }