PoNG CORS Proxy

From EWIKI
Jump to navigation Jump to search

Suppose you want to open the URL http:/otherdomain.com/ressource-xy e.g. as resourceURL, actionURL, tokenURL and it fails.

If you see a CORS error on the browser console (F12 is your friend) you must use a CORS proxy.

The provided CORS proxy is not a normal reverse proxy, it is specialized for REST/JSON calls. Usage is easy: Just add pong-proxy.php?p_url= before your target URL, e.g. pong-proxy.php?p_url=http:/otherdomain.com/ressource-xy -- that's all.

Oauth Tricks

OAuth2 is tricky to pass it through the proxy, since it expects POST with GET style parameters --- ooookeeee:

Try this:

...
"tokenURL": "pong-proxy.php?urlenc&p_url=https://otherdomain.com/oauth2/token"
...

or

...
"tokenURL": "pong-proxy.php?oauth2pwd&p_url=https://otherdomain.com/oauth2/token"
...

One of them should work.