Ejemplo n.º 1
0
 public function testSignature()
 {
     $request = new common_http_Request('http://example.com/oauthtest');
     $service = new tao_models_classes_oauth_Service();
     $signed = $service->sign($request, $this->oauthCustomer);
     //assert no exception
     $service->validate($signed);
 }
 /**
  * (non-PHPdoc)
  * @see common_user_auth_Adapter::authenticate()
  */
 public function authenticate()
 {
     $service = new tao_models_classes_oauth_Service();
     try {
         $service->validate($this->request);
         $ltiLaunchData = taoLti_models_classes_LtiLaunchData::fromRequest($this->request);
         return new taoLti_models_classes_LtiUser($ltiLaunchData);
     } catch (common_http_InvalidSignatureException $e) {
         throw new taoLti_models_classes_LtiException('Invalid LTI signature');
     }
 }