public static String getAppidFromAuthRequest(HttpServletRequest request) {
		String appid1 = request.getParameter("state");
		String appid2 = request.getParameter(Config._APPID);
		if (StringUtils.isBlank(appid1) && StringUtils.isBlank(appid2)) {
			if (StringUtils.startsWith(request.getRequestURI(), SAMLAuthFilter.SAML_ACTION + "/")) {
				return StringUtils.trimToNull(request.getRequestURI().substring(SAMLAuthFilter.SAML_ACTION.length() + 1));
			} else {
				return null;
			}
		} else if (!StringUtils.isBlank(appid1)) {
			return StringUtils.trimToNull(appid1);
		} else {
			return StringUtils.trimToNull(appid2);
		}
	}
public static String getAppidFromAuthRequest ( HttpServletRequest request ) { String appid1 = request . getParameter ( "state" ) ; String appid2 = request . getParameter ( Config . _APPID ) ; if ( StringUtils . isBlank ( appid1 ) && StringUtils . isBlank ( appid2 ) ) { if ( StringUtils . startsWith ( request . getRequestURI ( ) , SAMLAuthFilter . SAML_ACTION + "/" ) ) { return StringUtils . trimToNull ( request . getRequestURI ( ) . substring ( SAMLAuthFilter . SAML_ACTION . length ( ) + 1 ) ) ; } else { return null ; } } else if ( ! StringUtils . isBlank ( appid1 ) ) { return StringUtils . trimToNull ( appid1 ) ; } else { return StringUtils . trimToNull ( appid2 ) ; } }
@param request HTTP request
@return the appid if it's present in either the 'state' or 'appid' query parameters