Example #1
0
 public function validateRequest(sfWebRequest $request)
 {
     $server = $this->getOAuthServer();
     $oauthRequest = $this->getOAuthRequest();
     $oauthResponse = $this->getOAuthResponse();
     if (!$server->verifyResourceRequest($oauthRequest, $oauthResponse)) {
         $server->getResponse()->send();
         throw new sfStopException();
     }
     $tokenData = $server->getAccessTokenData($oauthRequest, $oauthResponse);
     $userId = $tokenData['user_id'];
     $userService = new SystemUserService();
     $user = $userService->getSystemUser($userId);
     $authService = new AuthService();
     $authService->setLoggedInUser($user);
     $this->getAuthenticationService()->setCredentialsForUser($user, array());
 }