code: private static Map<String, String> extractChallenge(String authenticateHeader, String authChallengePrefix) {
          if (!isValidChallenge(authenticateHeader, authChallengePrefix)) {
              return null;
          }
  
          authenticateHeader = authenticateHeader.toLowerCase().replace(authChallengePrefix.toLowerCase(), "");
  
          String[] challenges = authenticateHeader.split(", ");
          Map<String, String> challengeMap = new HashMap<String, String>();
          for (String pair : challenges) {
              String[] keyValue = pair.split("=");
              challengeMap.put(keyValue[0].replaceAll("\"", ""), keyValue[1].replaceAll("\"", ""));
          }
          return challengeMap;
      }
docs: Extracts the challenge off the authentication header.
  
  @param authenticateHeader
  the authentication header containing all the challenges.
  @param authChallengePrefix
  the authentication challenge name.
  @return a challenge map.