ok maybe i know the reason ..... if you use aws know ... According to this document ( http://docs.aws.amazon.com/cognito/latest/developerguide/token-endpoint.html )
Authorization If a secret has been provided to the client, the client must pass its client_id and client_secret into the authorization header through Basic HTTP authorization. The secret is Basic Base64Encode (client_id: client_secret).
they need to place the client and client section in the header ...
Then I use aws http proxy, caught google progress request.
Method request headers: {X-Cloud-Trace-Context=d7b6b9b8239965baf69acab659e80a01/13879251242019662389, CloudFront-Viewer-Country=US, CloudFront-Forwarded-Proto=https, CloudFront-Is-Tablet-Viewer=false, CloudFront-Is-Mobile-Viewer=false, User-Agent=google-oauth-playground AppEngine-Google; (+http://code.google.com/appengine; appid: s~oauth2playground), X-Forwarded-Proto=https, CloudFront-Is-SmartTV-Viewer=false, Host=en75z5h2rb.execute-api.us-east-1.amazonaws.com, Accept-Encoding=gzip, deflate, X-Forwarded-Port=443, X-Amzn-Trace-Id=Root=1-5a0fcef2-09197cd86a625ad47d78f0b7, Via=1.1 d63a8908759a2f4775b3f672ebf823cc.cloudfront.net (CloudFront), X-Amz-Cf-Id=nFdLK97vAS5HvmpNYkPpbUMOB4bCaM6pScHWTAReAnonLg1gXF7hSg==, X-Forwarded-For=107.178.195.199, 54.182.238.53, content-type=application/x-www-form-urlencoded, CloudFront-Is-Desktop-Viewer=true}
there is no authorization in the request header. so Cognito will go back
"error": "invalid_client"
And in accordance with this OAUTH2.0 specification ... https://tools.ietf.org/html/rfc6749#section-2.3.1
I already ask for aws support. They said.
* Thank you for contacting AWS for support and providing us with detailed links. I would be happy to help you with the issue that Cognito supports client credentials in the request body.
After reading the OAUTH2.0 RFC 6749 [0] standards, it seems that including client credentials in the request body is not recommended. Here is an excerpt from the specification:
"Including client credentials in the request body using two parameters is not recommended and should be limited to clients who cannot directly use the basic HTTP authentication scheme (or other password-based HTTP authentication schemes)." *