Max-
While I'm not sure of the error that you're seeing could you please provide a bit more information about the request made when you recieve this error?
What does your php code look like? Are you using the latest osapi SDK from opensocial.org?
If you could please post the url being redirected to and the HTTP request and response headers.
There is a working 3leggedOAuth example in the osapi SDK maybe look into this for ideas.
Thanks,
Jesse