public function register($request, $vosForRegistration, $registerUrL = null, $dynamicRegistration = null)
    {
        if (is_null($registerUrL)) {
            $registerUrL = $this->registerUrl;
        }

        if (is_null($dynamicRegistration)) {
            $dynamicRegistration = $this->dynamicRegistration;
        }

        $request['config'] = array(
            self::UIDS_ATTR => $this->uidsAttr,
            self::REGISTER_URL => $registerUrL,
            self::REGISTER_URL_BASE => $this->registerUrlBase,
            self::INTERFACE_PROPNAME => $this->interface,
            self::SOURCE_IDP_ENTITY_ID_ATTR => $this->sourceIdPEntityIDAttr,
            self::VO_SHORTNAME => $this->voShortName,
            self::PERUN_FACILITY_ALLOW_REGISTRATION_TO_GROUPS => $this->facilityAllowRegistrationToGroupsAttr,
            self::PERUN_FACILITY_CHECK_GROUP_MEMBERSHIP_ATTR => $this->facilityCheckGroupMembershipAttr,
            self::PERUN_FACILITY_DYNAMIC_REGISTRATION_ATTR => $this->facilityDynamicRegistrationAttr,
            self::PERUN_FACILITY_REGISTER_URL_ATTR => $this->facilityRegisterUrlAttr,
            self::PERUN_FACILITY_VO_SHORT_NAMES_ATTR => $this->facilityVoShortNamesAttr,
        );

        $stateId = State::saveState($request, 'perun:PerunIdentity');
        $callback = Module::getModuleURL('perun/perun_identity_callback.php', array('stateId' => $stateId));

        if ($dynamicRegistration) {
            $this->registerChooseVoAndGroup($callback, $vosForRegistration, $request);
        } else {
            $this->registerDirectly($request, $callback, $registerUrL);
        }
    }