简体   繁体   English

获取 Google 令牌以使用 Cognito 访问 Google 服务以获得 Alexa 技能

[英]Get Google Token to access google services using Cognito for an Alexa skill

I have enabled AWS Cognito for an alexa skill and enabled only google login for the users, now Cognito + google auth flow completes successfully, and We get a AWS bearer token ey... , Now I wish to use a google services AP (drive/gmail), sensitive/restricted Google APIs .我已经为 alexa 技能启用了 AWS Cognito,并且只为用户启用了 google 登录,现在 Cognito + google 身份验证流程成功完成,我们得到了一个 AWS 不记名令牌ey... ,现在我希望使用谷歌服务 AP(驱动/gmail)、敏感/受限的 Google API

Is this possible using the Cognito as auth provider?这是否可以使用 Cognito 作为身份验证提供程序? if not can I create a sort of Alexa + Node(middleware, to handle google auth, then pass code/tokens back to Alexa server)如果不能,我可以创建一种 Alexa + Node(中间件,处理谷歌身份验证,然后将代码/令牌传递回 Alexa 服务器)

Now I wish to use a google services AP (drive/gmail), sensitive/restricted Google APIs.现在我希望使用谷歌服务 AP(驱动器/gmail),敏感/受限的谷歌 API。 Is this possible using the Cognito as auth provider?这是否可以使用 Cognito 作为身份验证提供程序?

I don't think so.我不这么认为。

Let me explain.让我解释。 Cognito can be authentication provider for your application if you are developing an application.如果您正在开发应用程序,Cognito 可以作为您的应用程序的身份验证提供程序。 Many AWS services support Cognito (eg ElasticSearch, API Gateway, etc.).许多 AWS 服务都支持 Cognito(例如 ElasticSearch、API Gateway 等)。 But it doesn't mean that Google supports Cognito.但这并不意味着 Google 支持 Cognito。

Don't be mistaken by the fact that Cognito supports Google Login.不要误会 Cognito 支持 Google 登录这一事实。 It's the other way around called "federation".反之亦然,称为“联邦”。 In this mode, Google tells Cognito that the user is authenticated by Google and Cognito trusts this information.在这种模式下,Google 会告诉 Cognito 用户已通过 Google 的身份验证,并且 Cognito 信任此信息。 Now any application that uses Cognito, will "Login with Google".现在,任何使用 Cognito 的应用程序都将“使用 Google 登录”。

if not can I create a sort of Alexa + Node(middleware, to handle google auth, then pass code/tokens back to Alexa server)如果不能,我可以创建一种 Alexa + Node(中间件,处理谷歌身份验证,然后将代码/令牌传递回 Alexa 服务器)

Yes, this is possible.是的,这是可能的。 You can use AWS Secrets Manager to keep the Google secrets out of code.您可以使用 AWS Secrets Manager 将 Google 的机密排除在代码之外。

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

相关问题 Alexa 的 Google 助理技能 - Google Assistant Skill for Alexa AWS Alexa 技能中的访问令牌无效 - Invalid Access Token in AWS Alexa Skill 如何在 google oauth2 中使用刷新令牌获取访问令牌? - How to get access token using refresh token in google oauth2? 是否有 api 可以从 Amazon Alexa Skill Store 获取有关 Alexa 技能的详细信息 - Is there and api to get details of Alexa skill from Amazon Alexa Skill Store 仅使用访问令牌在节点中获取Google +用户个人资料 - Get google+ user profile in node using just access token 如何使用节点 js 客户端库使用刷新令牌谷歌 oAuth2 获取新的访问令牌 - How to get a new access token using refresh token google oAuth2 using node js client library 如何获得没有访问令牌的Google联系人? - How to get Google contacts without access token? 使用 google oauth2 节点库,无法使用刷新令牌获取新的访问令牌 - Using google oauth2 node library, can't get new access token with refresh token DyanmoDB获取功能Alexa技能范围问题 - DyanmoDB get function alexa skill scoping issue 如何使用 facebook 令牌或 google accesstoken 使用 nodejs 或 lambda 函数注册 AWS cognito? - How can I signup with AWS cognito using facebook token or google accesstoken using nodejs or lambda functions?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM