/** * Redirect to Authentication URL. * * @param int $state; * * @return \Illuminate\Http\Response; */ public function authenticate(int $state) { parent::authenticate($state); $redirUrl = \URL::route('package.Userdesk.submission.authenticate', ['website' => 'twitter', 'state' => $state]); $tw = $this->provider($redirUrl); $reqToken = $tw->requestRequestToken(); $url = $tw->getAuthorizationUri(['oauth_token' => $reqToken->getRequestToken()]); return redirect((string) $url); }
/** * Redirect to Authentication URL. * * @param int $state; * * @return \Illuminate\Http\Response;; */ public function authenticate(int $state) { parent::authenticate($state); $redirUrl = route('package.Userdesk.submission.authenticate', ['website' => 'facebook']); $fb = $this->provider($redirUrl); $url = $fb->getAuthorizationUri(['state' => $state]); return redirect((string) $url); }
/** * Redirect to Authentication URL. * * @param int $state; * * @return \Illuminate\Http\Response;; */ public function authenticate(int $state) { parent::authenticate($state); $redirUrl = route('package.Userdesk.submission.authenticate', ['website' => 'youtube']); $googleService = $this->provider($redirUrl); $googleService->setAccessType('offline'); $url = $googleService->getAuthorizationUri(['state' => $state]); return redirect((string) $url); }