public function createWidgetRegisterSession(array $allowedTypes = null, $recipient = null, $backupCodeIdentifier = null, $totpIdentifier = null, $issuer = null)
    {
        $widgetRegisterSession = $this->createEmptyWidgetRegisterSession();

        if ($allowedTypes !== null) {
            $widgetRegisterSession->setAllowedTypes($allowedTypes);
        }

        if ($recipient !== null) {
            $widgetRegisterSession->setRecipient($recipient);
        }
        if ($backupCodeIdentifier !== null) {
            $widgetRegisterSession->setBackupCodeIdentifier($backupCodeIdentifier);
        }

        if ($totpIdentifier !== null) {
            $widgetRegisterSession->setTotpIdentifier($totpIdentifier);
        }

        if ($issuer !== null) {
            $widgetRegisterSession->setIssuer($issuer);
        }

        return $widgetRegisterSession;
    }