lib/resource-server.js
function authenticate(options) {
        options = options || {};

        var authenticators = [
            passport.authenticate(['copress-oauth2-bearer', 'copress-oauth2-mac'],
                options)];
        if (options.scopes || options.scope) {
            authenticators.push(scopeValidator(options));
        }
        authenticators.push(oauth2Provider.errorHandler());
        return authenticators;
    }
function authenticate(options) {
        options = options || {};

        var authenticators = [
            passport.authenticate(['copress-oauth2-bearer', 'copress-oauth2-mac'],
                options)];
        if (options.scopes || options.scope) {
            authenticators.push(scopeValidator(options));
        }
        authenticators.push(oauth2Provider.errorHandler());
        return authenticators;
    }
function authenticate ( options ) { options = options || { } ; var authenticators = [ passport . authenticate ( [ 'copress-oauth2-bearer' , 'copress-oauth2-mac' ] , options ) ] ; if ( options . scopes || options . scope ) { authenticators . push ( scopeValidator ( options ) ) ; } authenticators . push ( oauth2Provider . errorHandler ( ) ) ; return authenticators ; }
Return the middleware chain to enforce oAuth 2.0 authentication and
authorization
@param {Object} [options] Options object
- scope
- jwt
Return the middleware chain to enforce oAuth 2 . 0 authentication and authorization