反向代理背后的 Oauth 提供程序 [英] Oauth provider behind reverse proxy
问题描述
我尝试在 apache 反向代理后面的 PHP(PECL 包)中使用 OAuth 提供程序
I try to use OAuth Provider in PHP (PECL Package) behind a apache reverse-proxy
客户端使用
POST https://api.com/resource/oauth/request-token
但我的 oauth 提供商收到
but my oauth provider receives
POST http://api.com/mywebservice/resource/oauth/request-token
无法验证签名所以请求失败
the signature cannot be verified so the request fails
您对解决此问题有什么想法吗?
have you any idea about resolving this issue?
推荐答案
我不得不这样做一次.我最终修改了 OAuth 代码以传递提供者将收到的实际 URL 以及我需要从代理后面发送到的 URL.前者用于签名,后者用于 HTTP 请求.这是一种痛苦且不可移植(如果代理中有任何更改,代码将停止工作)
I had to do this once. I ended up modifying the OAuth code to pass along the actual URL the provider will receive as well the URL I need to send to from behind my proxy. The former was used in the signature and the latter in the HTTP request. It was a pain and not portable (if anything changed in the proxy, the code would stop working)
这篇关于反向代理背后的 Oauth 提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!