protected function identity()
    {
        // Get authentication service
        if (null === $this->identity) {
            $authenticationService = $this->getServiceLocator()
                    ->get('Zend\Authentication\AuthenticationService');
            if (!$authenticationService->hasIdentity()) {
                throw new \Exception('No identity loaded');
            }
            $this->identity = $authenticationService->getIdentity();
        }

        return $this->identity;
    }