/** * Process data returned as callback from the client * * @param string $user_id * @param string $profile_id * @param array $data * @return \App\Models\Provider */ public function handleCallback($user_id, $profile_id, $data = []) { parent::handleCallback($user_id, $profile_id, $data); $shortToken = $this->token; $this->token = $this->client->getLongLivedAccessToken($shortToken); $user = $this->client->getResourceOwner($this->token)->toArray(); return $this->providerRepository->create($user_id, $profile_id, ServiceFacebook::SERVICE_CODE, ['token' => $this->token->getToken(), 'expires_at' => ServiceFacebook::TOKEN_TTL + time(), 'vendor_id' => $user['id'], 'email' => $user['email'], 'avatar' => $user['picture_url'], 'first_name' => $user['first_name'], 'last_name' => $user['last_name'], 'gender' => $user['gender']]); }
/** * Process data returned as callback from the client * * @param string $user_id * @param string $profile_id * @param array $data * @return \App\Models\Provider */ public function handleCallback($user_id, $profile_id, $data = []) { parent::handleCallback($user_id, $profile_id, $data); $user = $this->client->getResourceOwner($this->token)->toArray(); return $this->providerRepository->create($user_id, $profile_id, ServiceLinkedin::SERVICE_CODE, ['token' => $this->token->getToken(), 'expires_at' => $this->token->getExpires(), 'vendor_id' => $user['id'], 'email' => $user['emailAddress'], 'avatar' => $user['pictureUrl'], 'first_name' => $user['firstName'], 'last_name' => $user['lastName']]); }
/** * Process data returned as callback from the client * * @param string $user_id * @param string $profile_id * @param array $data * @return \App\Models\Provider */ public function handleCallback($user_id, $profile_id, $data = []) { parent::handleCallback($user_id, $profile_id, $data); $user = $this->client->getResourceOwner($this->token)->toArray(); return $this->providerRepository->create($user_id, $profile_id, ServiceInstagram::SERVICE_CODE, ['token' => $this->token->getToken(), 'expires_at' => ServiceInstagram::TOKEN_TTL + time(), 'vendor_id' => $user['id'], 'username' => $user['username'], 'avatar' => $user['profile_picture'], 'name' => $user['full_name']]); }
/** * Process data returned as callback from the client * * @param string $user_id * @param string $profile_id * @param array $data * @return \App\Models\Provider */ public function handleCallback($user_id, $profile_id, $data = []) { parent::handleCallback($user_id, $profile_id, $data); $user = $this->client->getResourceOwner($this->token)->toArray(); return $this->providerRepository->create($user_id, $profile_id, ServiceGoogle::SERVICE_CODE, ['token' => $this->token->getToken(), 'expires_at' => ServiceGoogle::TOKEN_TTL + time(), 'vendor_id' => $user['id'], 'email' => $user['emails'][0]['value'], 'avatar' => $user['image']['url'], 'first_name' => $user['name']['givenName'], 'last_name' => $user['name']['familyName']]); }