I suspect that your login scripts don’t even need the “file request” to be passed to it as a key’s value but that’s one option … and I’ll bet that the QSA is of no value to those scripts, too!
You’re on the right track with your redirections except that the R=301 and QSA won’t help AND the $1 not being included IN the updated query string WILL disable your redirections (they are NOT part of any useful extension, are they?).
Once you get past all that, try something like:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^{google|yandex|vk|twitter)\.mysite\.com$
// The NC flag won't help as the SEs are in the login scripts which are case sensitive
RewriteRule .? http://mysite.com/login_with_%1.php?request=%{REQUEST_URI} [L,QSA]
Note: It looks like the code is NOT being handled correctly by the new forum software but you should get the meaning.