code: function _parseWWWAuthenticate(header) {
      var parsers = require('www-authenticate/lib/parsers');
      var parsed = new parsers.WWW_Authenticate(header);
      if (parsed.err) {
          throw new Error('could not parse WWW-Authenticate header "' + header
              + '": ' + parsed.err);
      }
      return parsed;
  }
docs: Parse a WWW-Authenticate header like this:
  
  // JSSTYLED
  www-authenticate: Bearer realm="https://auth.docker.io/token",service="registry.docker.io"
  www-authenticate: Basic realm="registry456.example.com"
  
  into an object like this:
  
  {
  scheme: 'Bearer',
  parms: {
  realm: 'https://auth.docker.io/token',
  service: 'registry.docker.io'
  }
  }
  
  Note: This doesn't handle *multiple* challenges. I've not seen a concrete
  example of that.