public function setIdentity(ArrayAccess $identity)
    {
        $controller = $this->getController();

        $result = $this->getAuthenticationService()->persistIdentity(
            $controller->request,
            $controller->response,
            $identity
        );

        $controller->setRequest($result['request']);
        $controller->response = $result['response'];

        return $this;
    }