예제 #1
0
 /**
  * Checks if a valid user is logged in
  *
  * @throws \Exception
  * @return AccessControllerInterface::ACCESS
  */
 protected function checkAuthentication()
 {
     try {
         $isAuthenticated = $this->objectManager->getAuthenticationProvider()->authenticate();
     } catch (\Exception $exception) {
         Dispatcher::getSharedDispatcher()->logException($exception);
         throw $exception;
     }
     if ($isAuthenticated === FALSE) {
         return self::ACCESS_UNAUTHORIZED;
     }
     return self::ACCESS_ALLOW;
 }
예제 #2
0
 /**
  * @test
  */
 public function getAuthenticationProviderTest()
 {
     $object = $this->fixture->getAuthenticationProvider();
     $this->assertInstanceOf('Cundd\\Rest\\Authentication\\AuthenticationProviderInterface', $object);
 }