public function startup()
    {
        if (!$this->getConfig('requireIdentity')) {
            return;
        }

        $request = $this->getController()->request;
        $action = $request->getParam('action');
        if (in_array($action, $this->unauthenticatedActions)) {
            return;
        }

        $identity = $request->getAttribute($this->getConfig('identityAttribute'));
        if (!$identity) {
            throw new UnauthenticatedException();
        }
    }