/** * The Facebook callback URL returns here */ public function accessTokenFromFacebook() { $config = $this->application->config('oauth'); $request = $this->application->request(); // pass verification to the API so we can log in $clientId = $config['client_id']; $clientSecret = $config['client_secret']; // handle incoming vars $code = $request->get('code'); $authApi = new AuthApi($this->cfg, $this->accessToken); $result = $authApi->verifyFacebook($clientId, $clientSecret, $code); $this->handleLogin($result); }
/** * The callback URL should point to here */ public function accessTokenFromTwitter() { $config = $this->application->config('oauth'); $request = $this->application->request(); // pass verification to the API so we can log in $clientId = $config['client_id']; $clientSecret = $config['client_secret']; // handle incoming vars $token = $request->get('oauth_token'); $verifier = $request->get('oauth_verifier'); $authApi = new AuthApi($this->cfg, $this->accessToken); $result = $authApi->verifyTwitter($clientId, $clientSecret, $token, $verifier); $this->handleLogin($result); }