将Laravel与AWS Cognito集成

时间:2019-07-24 10:37:50

标签: amazon-web-services aws-sdk amazon-cognito

几个月前,我配置了一个AWS Cognito用户池,并将其连接到node.js应用程序,一切都很完美

现在,我想将laravel连接到AWS Cognito,我按照此article

中的说明进行操作

我收到以下错误

Error executing "AdminInitiateAuth" on "https://cognito-idp.eu-west-1.amazonaws.com"; AWS HTTP error: Client error: `POST https://cognito-idp.eu-west-1.amazonaws.com` resulted in a `400 Bad Request` response:
{"__type":"UnrecognizedClientException","message":"The security token included in the request is invalid."}
UnrecognizedClientException (client): The security token included in the request is invalid. - {"__type":"UnrecognizedClientException","message":"The security token included in the request is invalid."}  

我完全确定凭据正确无误,但出现此错误。 文章中是否缺少任何配置?

1 个答案:

答案 0 :(得分:0)

在同一篇文章之后,我遇到了同样的“问题”。我已通过验证.env

中的凭据来解决此问题
AWS_COGNITO_KEY=
AWS_COGNITO_SECRET=

这些是IAM用户的访问密钥

https://github.com/black-bits/laravel-cognito-auth#cognito-user-pool