Javascript cognito+;API网关。正在获取状态401

Javascript cognito+;API网关。正在获取状态401,javascript,node.js,amazon-web-services,aws-api-gateway,amazon-cognito,Javascript,Node.js,Amazon Web Services,Aws Api Gateway,Amazon Cognito,我用带有API网关的Express包装了API。 我正在使用CognitoUserPool对API网关进行身份验证 当我使用Angular2HTTP服务访问该API时,返回了正常值。 但是,当身份验证失败时,会出现以下错误 No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed acce

我用带有API网关的Express包装了API。 我正在使用CognitoUserPool对API网关进行身份验证

当我使用Angular2HTTP服务访问该API时,返回了正常值。 但是,当身份验证失败时,会出现以下错误

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 401.
我正确地设置了头映射,但是这次我得到了这个错误

当我使用Postman访问它时,我得到以下结果

{

 "message": "Unauthorized"

}
当使用Angular2访问时,我也希望得到相同的结果


这可能吗?

不幸的是,在某些错误情况下(如401/403),即使配置正确,API网关也不会返回CORS头


我们知道这是客户的一个痛点,正在制定解决方案,但无法承诺何时提供解决方案。

我理解。aws的通信让我很难过。@tomoyaishizaka关于这个问题有任何更新吗?你是怎么解决的?@eldos,看看这里的解决方案