public static boolean isAuthenticatedRequest(HttpServletRequest request)
			throws Exception {

		try {
			String mobileHash = request.getParameter(TXTWEB_MOBILE_PARAM);
			String message = request.getParameter(TXTWEB_MESSAGE_PARAM);
			String verifyId = request.getParameter(TXTWEB_VERIFY_PARAM);
			String protocol = request.getParameter(TXTWEB_PROTOCOL_PARAM);

			if (mobileHash == null || verifyId == null || protocol == null) {
				return false;
			}
			String params = TXTWEB_MOBILE_PARAM
					+ '='
					+ URLEncoder.encode(mobileHash, "UTF-8")
					+ '&'
					+ (message != null ? (TXTWEB_MESSAGE_PARAM + '='
							+ URLEncoder.encode(message, "UTF-8") + '&') : "")
					+ TXTWEB_PROTOCOL_PARAM + '='
					+ URLEncoder.encode(protocol, "UTF-8") + '&'
					+ TXTWEB_VERIFY_PARAM + '='
					+ URLEncoder.encode(verifyId, "UTF-8");
			Document doc = DocumentBuilderFactory.newInstance()
					.newDocumentBuilder()
					.parse(new URL(VERIFY_MSG_URL + '?' + params).openStream());
			Properties properties = parseToProperties(doc);
			Logger.getLogger(TxtWebApiUtil.class.getName()).info(
					properties.toString());
			String value = properties.getProperty("txtWeb.status.code");
			return "0".equals(value);
		} catch (Exception e) {
			throw new Exception("Unable to verify your request with txtweb", e);
		}
	}