lib/utils.js
function(req){
    var token = null;
    if (req.headers && req.headers.authorization) {
      var parts = req.headers.authorization.split(' ');
      if (parts.length === 2){
        var scheme = parts[0];
        var credentials = parts[1];

        if (/^Bearer$/i.test(scheme)){
           token = credentials;
        }
      }
    }else{
      token = this.allParams(req).access_token;
    }
    return token;
  }
function(req){
    var token = null;
    if (req.headers && req.headers.authorization) {
      var parts = req.headers.authorization.split(' ');
      if (parts.length === 2){
        var scheme = parts[0];
        var credentials = parts[1];

        if (/^Bearer$/i.test(scheme)){
           token = credentials;
        }
      }
    }else{
      token = this.allParams(req).access_token;
    }
    return token;
  }
function ( req ) { var token = null ; if ( req . headers && req . headers . authorization ) { var parts = req . headers . authorization . split ( ' ' ) ; if ( parts . length === 2 ) { var scheme = parts [ 0 ] ; var credentials = parts [ 1 ] ; if ( / ^Bearer$ / i . test ( scheme ) ) { token = credentials ; } } } else { token = this . allParams ( req ) . access_token ; } return token ; }
Return access token from request

@param  {Object} req the express request object
@return {String} token
@api public
Return access token from request