src/index.js
/**
   * Parses an OAuth2 RFC6750 bearer authorization token, this method additionally is RFC 2616 compliant and respects
   * case insensitive headers.
   *
   * @param {Object} req http request object
   * @returns {String} value for field within body, query, or headers
   */
Parses an OAuth2 RFC6750 bearer authorization token, this method additionally is RFC 2616 compliant and respects
case insensitive headers.

@param {Object} req http request object
@returns {String} value for field within body, query, or headers
Parses an OAuth2 RFC6750 bearer authorization token this method additionally is RFC 2616 compliant and respects case insensitive headers . @param { Object } req http request object @returns { String } value for field within body query or headers
parseOAuth2Token(req) {
    const OAuth2AuthorizationField = 'Authorization';
    const headerValue = (req.headers && (req.headers[OAuth2AuthorizationField] || req.headers[OAuth2AuthorizationField.toLowerCase()]));
    return (
      headerValue && (() => {
        const bearerRE = /Bearer\ (.*)/;
        let match = bearerRE.exec(headerValue);
        return (match && match[1]);
      })()
    );
  }
parseOAuth2Token ( req ) { const OAuth2AuthorizationField = 'Authorization' ; const headerValue = ( req . headers && ( req . headers [ OAuth2AuthorizationField ] || req . headers [ OAuth2AuthorizationField . toLowerCase ( ) ] ) ) ; return ( headerValue && ( ( ) => { const bearerRE = / Bearer\ (.*) / ; let match = bearerRE . exec ( headerValue ) ; return ( match && match [ 1 ] ) ; } ) ( ) ) ; }
Parses an OAuth2 RFC6750 bearer authorization token, this method additionally is RFC 2616 compliant and respects
 case insensitive headers.
Parses an OAuth2 RFC6750 bearer authorization token this method additionally is RFC 2616 compliant and respects case insensitive headers .