I need ID_TOKEN to access the Cognito Identity pool to implement the "sync user dataset".
At that time when I configured alexa smart skill and Cognito, I found alexa initiated discovery request just with accesstoken. Consult the engineers on the side of Cognito, and they gave me the answer is when filling in the correct authorization request, server will return " accessToken and ID_TOKEN". (http://docs.aws.amazon.com/cognito/latest/developerguide/authorization-endpoint.html)
Then I built a "http proxy" with api gateway between alexa and cognito oauth2.0 server(https://developer.amazon.com/blogs/post/TxQN2C04S97C0J/how-to-set-up-amazon-api-gateway-as-a-proxy-to-debug-account-linking) From this "proxy" intercepted information, Cognito does return "id token" and "access token"(see http_proxy.png and alexa_token.png). The problem is alexa seems to have dropped ID token. The following two attachments are information printed from Cloudwatch.
Now the problem is how can i get ID_TOKEN from alexa?
PS, It's strange I cannot upload any pictrue....
Ok, fine... here is the "http_proxy.png"
(474bbe27-72b6-11e7-8c37-470a47616d7a) Endpoint request URI: https://bruceauth.auth.us-east-1.amazoncognito.com/token (474bbe27-72b6-11e7-8c37-470a47616d7a) Endpoint request headers: {x-amzn-apigateway-api-id=9keqckz09c, CloudFront-Viewer-Country=US, CloudFront-Forwarded-Proto=https, CloudFront-Is-Tablet-Viewer=false, User-Agent=Apache-HttpClient/4.5.x (Java/1.8.0_131), CloudFront-Is-Mobile-Viewer=false, X-Forwarded-Proto=https, CloudFront-Is-SmartTV-Viewer=false, Host=bruceauth.auth.us-east-1.amazoncognito.com, Accept-Encoding=, X-Forwarded-Port=443, X-Amzn-Trace-Id=Root=1-5979c036-1e78f84f794df9e113a84e94, Via=1.1 73388dc3c76783aef93703e1dfb340e2.cloudfront.net (CloudFront), Authorization=********************************************************************************************************MxaTBm, X-Amz-Cf-Id=ucJTNSNhaS07jBMko2Y3ePp33ikO9OU9Gvr-qRV3BH8lpvUH2Fi1SQ==, X-Forwarded-For=72.21.217.133, 54.182.230.67, CloudFront-Is-Desktop-Viewer=true, Content-Type=application/x-www-form-urlencoded} (474bbe27-72b6-11e7-8c37-470a47616d7a) Endpoint request body after transformations: grant_type=authorization_code&code=508138f6-5110-4479-a2b2-798bf3349c55&redirect_uri=https%3A%2F%2Fpitangui.amazon.com%2Fapi%2Fskill%2Flink%2FM2Y6X5G2WRK0AR&client_id=6raclfd4r92uj78m1hr8rfcrmv (474bbe27-72b6-11e7-8c37-470a47616d7a) Endpoint response body before transformations: {"id_token":"eyJraWQiOiJZNTVTRUFmMUNDelZrV2tZWE1meGxObHV5aUxWZk95YzhyNHZZbnpwOFZNPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiIzMTIzODg4ZS03NmRmLTQ4YjItODdlNC1kN2M5YjY1ZTMyYmEiLCJhdWQiOiI2cmFjbGZkNHI5MnVqNzhtMWhyOHJmY3JtdiIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTUwMTE1MTI4NiwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfUzVrYnd1U2tOIiwiY29nbml0bzp1c2VybmFtZSI6InJhaW55Y29kZUBob3RtYWlsLmNvbSIsImV4cCI6MTUwMTE1NDg4NiwiaWF0IjoxNTAxMTUxMjg2LCJlbWFpbCI6InJhaW55Y29kZUBob3RtYWlsLmNvbSJ9.A8x_4caJ1XRQotKzB_PmeLLYuuxGfkrE9m4XqZ_I0xVNzIkt-XuM9qoKMGgvdqOPehqtbYCHu_jfGcGYKUAocu6Fh1L9B4BP-DKs8JAuzl3Yse7lw8WQrBDBnIzQlY2MyO6S_revNwueBH7U1yg_Ds9niRVhjfBwHqJvv-e19MpCg2iXE1wurFsG6vhQWbpUnk2t72gheJ415l9bfMRRLTz18lRjlzJPk1jCiRU90zVWj566t2LeDOuclUBzYMxzI48PIVLZXdd3ovkZRZ0BblFnNhno2Y_ATlknQK94PCWAXhnCTGQxQcW6WwFjeYD2HV1ijwda2eaTjs6tSP7cRw","access_token":"eyJraWQiOiI5ZE9NUmRXdG1lQ25vcGZIdkZ6NmtJRHdrSVRkRlRzZEErSWtZYnRBQlNRPSIsImF [TRUNCATED]