Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
A question, will OAuth work through a forward proxy?
Details as follows.
My apologies for cross posting. I originally posted a support question here regarding my failure to use the Twitter module through a forward proxy:
https://drupal.org/node/2218343
However, I am now wondering if the issue might be that since OAuth seems curl rather than say, drupal_http_request that using a forward might simply not be possible.
Thanks.
Cheers
Brett S
Comment | File | Size | Author |
---|---|---|---|
#2 | oauth_forward_proxy-2218645-3.patch | 1.67 KB | froboy |
Comments
Comment #1
BrettSh CreditAttribution: BrettSh commentedComment #2
froboyThis is indeed an issue. I don't want to get into/start a curl/drupal_http_request debate, but I think I've worked up a fix that should solve the issue while still using curl. I'm grabbing the proxy variables that drupal_http_request would use but then setting curl to use them via CURLOPT_PROXY. Check it out.
Comment #3
zaphoyd CreditAttribution: zaphoyd commentedI can confirm that OAuth 7.x-3.2 does not work on backend machines behind a firewall that must communicate externally through a proxy. This issue in turn breaks all modules that rely on OAuth for authenticating requests to external servers.
I've tested the patch in #2 and it has been running happily in our production environment, which requires a forward proxy for all outbound traffic, for a few weeks. This patch uses the standard proxy variables that D7 core uses and is minimally invasive to the rest of the code (does nothing unless said proxy variables are set).
Comment #4
zaphoyd CreditAttribution: zaphoyd commentedLinking to an older issue with a slightly different patch that uses drupal_http_request. I think the drupal_http_request method is better in the absence of any particular guidance from the maintainers on why cURL. That said, both are reasonable options and either would be preferable to nothing.