I created an APP on BufferApp.
In redirect URL I did insert my main domain (http://www.example.com/get_token).
In this mode I could re-use same APP for several website, with different URIs, without necessity to create an APP for every website or copy/paste token(s) (in Oauth2 you need to specify the redirect URI).
For Facebook, Twitter, Instagram and some others I follow same pattern.
NEW_SITE_TO_AUTHORIZE = >
Oauth2 Provider = >
MAIN and DIFFERENT DOMAIN THE ONLY ONE WITH THE LOGIC = >
redirect to NEW_SITE_TO_AUTHORIZE
transfering tokens via GET. Some service provide some "placeholder" in which I insert the URL of the "NEW SITE TO AUTHORIZE" and redirect to it after getting the code.
With BufferApp I did try to append another querystring ("&return=..."
) but it lost "on the way".
Do you have some idea to bypass this problem?
OK, I found a GET "state" that mantains value between domains. I write here for someone with same problem.
So url here:
GET https://bufferapp.com/oauth2/authorize?
client_id=...&
redirect_uri=...&
response_type=code
could be:
GET https://bufferapp.com/oauth2/authorize?
client_id=...&
redirect_uri=...&
response_type=code&
state=RETURN_URL