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

CommentFileSizeAuthor
#2 oauth_forward_proxy-2218645-3.patch1.67 KBfroboy
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BrettSh’s picture

Title: Will OAuth Work Through Forward Proxy » Will OAuth Work Through Forward Proxy?
froboy’s picture

This 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.

zaphoyd’s picture

Component: Miscellaneous » Code
Category: Support request » Feature request
Status: Active » Needs review

I 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).

zaphoyd’s picture

Linking 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.