简体   繁体   English

如何将 AWS Lambda function 添加为授权 javascript 来源在 Google Z54699D9A7E6DF4EDBCA4053281B25Z 中。

[英]How to add AWS Lambda function as an authorized javascript origin in Google OAuth 2.0

I have managed to get user OAuth 2.0 access and refresh token on the PHP backend but when I send those tokens to the lambda function they work until the access token is expired. I have managed to get user OAuth 2.0 access and refresh token on the PHP backend but when I send those tokens to the lambda function they work until the access token is expired. Once the access token is expired, the Google API javascript library tries to fetch new access token from the refresh token and fails because it is not authorized in the javascript origins in Google Developer console.访问令牌过期后,Google API javascript 库尝试从刷新令牌中获取新的访问令牌并失败,因为它未在 Google Developer 控制台中的 javascript 来源中获得授权。 I have no idea what should I put in the authorized javascript origins to allow AWS Lambda Function.我不知道我应该在授权的 javascript 来源中添加什么以允许 AWS Lambda Function。 Please help me out.请帮帮我。

Assuming you are using AWS Cognito to set up a user pool: go to your user pool in the AWS console.假设您使用 AWS Cognito 在 AWS 控制台中设置用户池:go 到您的用户池。 Go to APP Integration and create a cognito domain. Go 到 APP 集成并创建认知域。 It will generate a URL for the Cognito domain.它将为 Cognito 域生成 URL。 Put this in the authorized javascript origins on the Google console.把这个放在 Google 控制台上授权的 javascript origins 中。

See the documentation from AWS: https://aws.amazon.com/premiumsupport/knowledge-center/cognito-google-social-identity-provider/请参阅 AWS 的文档: https://aws.amazon.com/premiumsupport/knowledge-center/cognito-google-social-identity-provider/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM