[英]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.