/** * constructor * * @param object $app app object. * @return none. */ public function __construct($app, $callback_page = 'login') { parent::__construct($app, 'Facebook'); // TODO: these should be fetched from the site settings for this plugin (e.g. $app->site->get('oauth', 'client_id'); ) $clientId = '<CLIENT ID>'; $clientSecret = '<SECRET>'; $graphApiVersion = ""; // probably "v2.0" $this->_provider = new \League\OAuth2\Client\Provider\Facebook(['clientId' => $clientId, 'clientSecret' => $clientSecret, 'graphApiVersion' => $graphApiVersion, 'redirectUri' => $this->_app->site->uri['public'] . "/oauth/facebook/{$callback_page}"]); // $this->_provider->fields = $oaFields; }
/** * constructor * * @param object $app app object. * @return none. */ public function __construct($app, $callback_page = 'login') { parent::__construct($app, 'LinkedIn'); // TODO: these should be fetched from the site settings for this plugin (e.g. $app->site->get('oauth', 'client_id'); ) $clientId = '<CLIENT ID>'; $clientSecret = '<SECRET>'; $scopes = ['r_basicprofile', 'r_emailaddress']; $oaFields = ['id', 'email-address', 'first-name', 'last-name', 'headline', 'location', 'industry', 'picture-url', 'public-profile-url', 'summary', 'specialties', 'positions']; // $this->_provider = new \League\OAuth2\Client\Provider\LinkedIn([ // 'clientId' => $clientId, // 'clientSecret' => $clientSecret, // 'redirectUri' => $this->_app->site->uri['public'] . "/oauth/linkedin/$callback_page", // 'scopes' => $scopes]); $this->_provider = new \League\OAuth2\Client\Provider\LinkedIn(['clientId' => $clientId, 'clientSecret' => $clientSecret, 'redirectUri' => $this->_app->site->uri['public'] . "/oauth/linkedin/{$callback_page}"]); $this->_provider->fields = $oaFields; }