Amazon Cognito:来自oauth2 / token的500

时间:2017-09-11 15:18:56

标签: amazon-cognito

托管用户界面返回code - 我正在尝试将此代码更改为access_token - 根据documentation

我的要求是:

curl https://<my-domain>.auth.us-east-1.amazoncognito.com/oauth2/token \

--header 'Authorization: Basic BlY29sdfzMycGsdf25jMm81M2VscsdfA2bWQ4OWt2cDQsdfhMGJwMnNpNXJ1NzJzNWk5cGd2NAo=' \

--data 'grant_type=authorization_code&' \

'client_id=x3pasa249s4cqr3eotl9fc32po&' \

'code=daf413bb-5109-4086-a172-a5be35cb417e&' \

'redirect_uri=<my-page>' \

--verbose

我看到了这个回应:

*   Trying 34.204.237.202...
* TCP_NODELAY set
* Connected to intelligent-speaker.auth.us-east-1.amazoncognito.com (34.204.237.202) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.auth.us-east-1.amazoncognito.com
* Server certificate: Symantec Class 3 Secure Server CA - G4
* Server certificate: VeriSign Class 3 Public Primary Certification Authority - G5
> POST /oauth2/token HTTP/1.1
> Host: intelligent-speaker.auth.us-east-1.amazoncognito.com
> User-Agent: curl/7.54.0
> Accept: */*
> Authorization: Basic BlY29sdfzMycGsdf25jMm81M2VscsdfA2bWQ4OWt2cDQsdfhMGJwMnNpNXJ1NzJzNWk5cGd2NAo=
> Content-Length: 169
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 169 out of 169 bytes
< HTTP/1.1 500 Internal Server Error
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Content-Type: application/json;charset=UTF-8
< Date: Mon, 11 Sep 2017 15:06:51 GMT
< Expires: 0
< Pragma: no-cache
< Server: Server
< Set-Cookie: XSRF-TOKEN=5999ddd4-855c-4bfa-aeb8-c0e51e6e29c6; Path=/; Secure; HttpOnly
< Strict-Transport-Security: max-age=31536000 ; includeSubDomains
< x-amz-request-id: 22fccdc7-ac87-4c62-8297-76e947918ba8
< X-Application-Context: application:prod:8443
< X-Content-Type-Options: nosniff
< X-Frame-Options: DENY
< X-XSS-Protection: 1; mode=block
< Content-Length: 26
< Connection: keep-alive
<
* Connection #0 to host intelligent-speaker.auth.us-east-1.amazoncognito.com left intact
{"error":"Internal Error"}

HTTP状态代码500内部错误 - 这是亚马逊的一个问题,我无法解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

我添加了标题Accept-Encoding: 'gzip'