code: public static String extractAccessKey(HttpServletRequest request) {
  		if (request == null) {
  			return "";
  		}
  		String accessKey = "";
  		String auth = request.getHeader(HttpHeaders.AUTHORIZATION);
  		boolean isAnonymousRequest = isAnonymousRequest(request);
  		if (StringUtils.isBlank(auth)) {
  			auth = request.getParameter("X-Amz-Credential");
  			if (!StringUtils.isBlank(auth)) {
  				accessKey = StringUtils.substringBetween(auth, "=", "/");
  			}
  		} else {
  			if (isAnonymousRequest) {
  				accessKey = StringUtils.substringAfter(auth, "Anonymous").trim();
  			} else {
  				accessKey = StringUtils.substringBetween(auth, "=", "/");
  			}
  		}
  		if (isAnonymousRequest && StringUtils.isBlank(accessKey)) {
  			// try to get access key from parameter
  			accessKey = request.getParameter("accessKey");
  		}
  		return accessKey;
  	}
docs: Extracts the access key from a request. It can be a header or a parameter.
  @param request a request
  @return the access key