/** * Generates new XSRF token. * * @return session cookie MD5 hash. */ private String generateTokenValue() { if (sessionCookieName == null) { throw new IllegalStateException(COOKIE_NAME_NOT_SET_ERROR_MSG); } // generate XSRF cookie using session cookie Cookie sessionCookie = Util.getCookie(getThreadLocalRequest(), sessionCookieName, false); if (sessionCookie == null || sessionCookie.getValue() == null || sessionCookie.getValue().length() == 0) { throw new RpcTokenException("Session cookie is not set or empty! " + "Unable to generate XSRF cookie"); } byte[] cookieBytes = sessionCookie.getValue().getBytes(); return StringUtils.toHexString(Md5Utils.getMd5Digest(cookieBytes)); }
/** * Generates new XSRF token. * * @return session cookie MD5 hash. */ private String generateTokenValue() { if (sessionCookieName == null) { throw new IllegalStateException(COOKIE_NAME_NOT_SET_ERROR_MSG); } // generate XSRF cookie using session cookie Cookie sessionCookie = Util.getCookie(getThreadLocalRequest(), sessionCookieName, false); if (sessionCookie == null || sessionCookie.getValue() == null || sessionCookie.getValue().length() == 0) { throw new RpcTokenException("Session cookie is not set or empty! " + "Unable to generate XSRF cookie"); } byte[] cookieBytes = sessionCookie.getValue().getBytes(); return StringUtils.toHexString(Md5Utils.getMd5Digest(cookieBytes)); }
/** * Generates new XSRF token. * * @return session cookie MD5 hash. */ private String generateTokenValue() { if (sessionCookieName == null) { throw new IllegalStateException(COOKIE_NAME_NOT_SET_ERROR_MSG); } // generate XSRF cookie using session cookie Cookie sessionCookie = Util.getCookie(getThreadLocalRequest(), sessionCookieName, false); if (sessionCookie == null || sessionCookie.getValue() == null || sessionCookie.getValue().length() == 0) { throw new RpcTokenException("Session cookie is not set or empty! " + "Unable to generate XSRF cookie"); } byte[] cookieBytes = sessionCookie.getValue().getBytes(); return StringUtils.toHexString(Md5Utils.getMd5Digest(cookieBytes)); }