code: private AuthenticationResult getAuthenticationCredentials(Boolean supportsPop, Map<String, String> challengeMap) {
  
          String authorization = challengeMap.get("authorization");
          if (authorization == null) {
              authorization = challengeMap.get("authorization_uri");
          }
  
          String resource = challengeMap.get("resource");
          String scope = challengeMap.get("scope");
          String schema = supportsPop ? "pop" : "bearer";
          return doAuthenticate(authorization, resource, scope, schema);
      }
docs: Extracts the authentication challenges from the challenge map and calls the
  authentication callback to get the bearer token and return it.
  
  @param supportsPop
  is resource supports pop authentication.
  @param challengeMap
  the challenge map.
  @return AuthenticationResult with bearer token and PoP key.