Twitter authentication time out


We have some customers that are trying to authorize their twitter accounts on our site, but from certain locations (corporate environment) this cannot be done. I assume it is because of firewall rules.
They receive the pop-up asking to “Authorize [company name] to use your account”, they click the Authorize app button, the page then says “Redirecting you back to the application. This may take a few moments”, then it times out and shows the 504 - No Response from Server error.

Is anyone aware of particular rules/ports/protocols that need to be opened on firewalls to get this to work?