lib/oauth2_client.js
function(oauth2_server_id, res, next_url, state) {
    var sconfig = this.config.servers[oauth2_server_id];
    var cconfig = this.config.client;
    var data = {
      client_id: sconfig.client_id,
      redirect_uri: cconfig.redirect_uri,
      response_type: 'code',
      state: this.serializer.stringify([oauth2_server_id, next_url, state || null])
    };
    var url = sconfig.server_authorize_endpoint +'?'+ querystring.stringify(data);
    redirect(res, url);
  }
function(oauth2_server_id, res, next_url, state) {
    var sconfig = this.config.servers[oauth2_server_id];
    var cconfig = this.config.client;
    var data = {
      client_id: sconfig.client_id,
      redirect_uri: cconfig.redirect_uri,
      response_type: 'code',
      state: this.serializer.stringify([oauth2_server_id, next_url, state || null])
    };
    var url = sconfig.server_authorize_endpoint +'?'+ querystring.stringify(data);
    redirect(res, url);
  }
function ( oauth2_server_id , res , next_url , state ) { var sconfig = this . config . servers [ oauth2_server_id ] ; var cconfig = this . config . client ; var data = { client_id : sconfig . client_id , redirect_uri : cconfig . redirect_uri , response_type : 'code' , state : this . serializer . stringify ( [ oauth2_server_id , next_url , state || null ] ) } ; var url = sconfig . server_authorize_endpoint + '?' + querystring . stringify ( data ) ; redirect ( res , url ) ; }
Redirects the user to OAuth2 server for authentication.

Arguments:
- oauth2_server_id: OAuth2 server identification (ex: "facebook.com").
- res
- next_url: an url to redirect to once the process is complete.
- state: optional, a hash containing info you want to retrieve at the end
of the process.
Redirects the user to OAuth2 server for authentication .