Ejemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     $client = new Google_Client();
     $this->service = new Google_Service_Plus($client);
     if (Cache::has('service_token')) {
         $client->setAccessToken(Cache::get('service_token'));
     }
     $key = file_get_contents(storage_path(env('GOOGLE_SERVICE_KEY')));
     $scopes = array('https://www.googleapis.com/auth/plus.login', 'https://www.googleapis.com/auth/plus.me');
     $cred = new Google_Auth_AssertionCredentials(env('GOOGLE_SERVICE_EMAIL'), $scopes, $key);
     $client->setAssertionCredentials($cred);
     if ($client->getAuth()->isAccessTokenExpired()) {
         $client->getAuth()->refreshTokenWithAssertion($cred);
     }
     Cache::forever('service_token', $client->getAccessToken());
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
     FacebookSession::setDefaultApplication(config('services.facebook.client_id'), config('services.facebook.client_secret'));
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     parent::__construct();
 }