We managed to find a way to add the "allow-same-origin" property to iframes.
The script responsible for setting iframe properties on on-premise setups can be found in this bundle: Contentbundle=vss-bundle-common-vGHXheZgS3hyMaUbzls41rxhWznakbcMb0Pqw4EJu1BA=
The script can be found by navigating to a work item, opening developer tools & checking sources like so:
Step 1:
Download the file and add "allow-same-origin" to the sandbox properties (file is big so use ctrl+f to find the relevant line). Use the same file name (so Content?bundle=vss... yes, it's a long one)
pre-edit:
post-edit:
Step 2:
Save the edited file somewhere on your server like so:
Next add the following redirection rule to "Azure DevOps Server" - not "tfs", this will redirect to your new javascript file with "allow-same-origin" added to the properties (remember to adjust the path to the file!)
Your web requests should now have a proper origin, instead of origin = null.
This solved our issue and we are now able to send credentials with web requests made from our extension.