简体   繁体   English

AWS 认知授权

[英]AWS cognito authorization

I have an application (node.js) that need an Authentication and authorization.我有一个需要身份验证和授权的应用程序 (node.js)。 My app need access to postgres database and also need a Inheritances (roles etc.)我的应用程序需要访问 postgres 数据库,还需要继承(角色等)

One option to implement that is using the cognito service of aws (the app will host on aws properly - not sure about that)实现的一种选择是使用 aws 的认知服务(该应用程序将正确托管在 aws 上 - 不确定)

so the questions is所以问题是

  1. Is cognito service support the authorization for node.js with database that is not services on aws? Cognito 服务是否支持 node.js 的授权,数据库不是 aws 上的服务? (I read that "identity pool" is for aws services like mariaDB) (我读到“身份池”适用于像 mariaDB 这样的 aws 服务)
  2. If my app will be on heroku (not on aws), I will also be able to use with cognito services (for authorization )?如果我的应用程序将在 heroku 上(而不是在 aws 上),我还可以使用认知服务(用于授权)吗?
  3. Is cognito support roles/users inheritances? Cognito 是否支持角色/用户继承?

Tnx发件人

Cognito identity pool is used for granting access to aws services. Cognito 身份池用于授予对 aws 服务的访问权限。 User pool is used to exchange user credentials for tokens which can contain additional information about the user once decoded.用户池用于交换令牌的用户凭据,一旦解码,令牌可以包含有关用户的附加信息。 So yes, you can use user pool just for authentication.所以是的,您可以仅使用用户池进行身份验证。 Your user attributes can contain information related to the services this user needs to access.您的用户属性可以包含与该用户需要访问的服务相关的信息。

However, if you plan on storing database credentials, I suggest you use AWS secrets manager to store your DB credentials and grant the cognito user access to this secret.但是,如果您计划存储数据库凭据,我建议您使用 AWS secrets manager 来存储您的数据库凭据并授予 cognito 用户访问此机密的权限。 You'll need to use both user pool and identity pool in this case.在这种情况下,您需要同时使用用户池和身份池。

  1. Not directly, but you can use it to access secrets manager where you db credentials are stored.不是直接的,但您可以使用它来访问存储数据库凭据的机密管理器。
  2. Yes you can use cognito anywhere.是的,您可以在任何地方使用 Cognito。 It will be connecting to AWS to grant you tokens however.但是,它将连接到 AWS 以授予您令牌。 And these tokens are only recognized on AWS.而且这些令牌只在 AWS 上被识别。 Which is why you need to use them to access other secrets that can be used to access whatever other services you want.这就是为什么您需要使用它们来访问可用于访问您想要的任何其他服务的其他秘密。
  3. Cognito supports groups. Cognito 支持群组。 I'm not sure if that's what you mean by inheritences.我不确定这是否是您所说的继承的意思。 You can have token based roles with groups.您可以在组中拥有基于令牌的角色。

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

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