I am developing an API API agent and trying to implement account binding functionality. The documentation on oauth2-codeflow is really useful, and I can create my oauth stream and test the same thing on the google play area . Everything is working fine here.
But when I try to check it in a web simulator, I keep getting "it looks like your agent account is not connected yet." I followed the debug URL and followed the login and authorization steps.
According to this SO Question : I should expect the browser to be redirected to https://www.google.com/?result_code=SUCCESS&result_message=Accounts+now+linked, but my browser is always redirected to https://www.google.co.in/?gws_rd=cr&ei=QDOEWfCAPMHA0gSUvJj4Agand to the agent, I still get the message accounts not linked.
I see that Google can call my token endpoint using grantType: authorization_code, and my service responds as follows:
POST for /myendpoint/tokens has begun for: grantType:authorization_code clientId:google-clientid...8
My service answer:
{
"token_type":"bearer",
"access_token":"ab092868.....e804bcac",
"refresh_token":"e11e6d3054883...b30",
"expires_in":3600
}
I took advantage of the suggestion in the SO Question , but my answer has no additional parameters. It's simple and simple
I am sending the above answer through a nodejs application with the following code:
res.setHeader('Cache-Control', 'no-store');
res.setHeader('Pragma', 'no-cache');
res.setHeader('Content-Type', 'application/json;charset=UTF-8');
res.send(JSON.stringify(respObj));
I am really amazed and could not find a way out! Kindly help.
source
share