首页 > 解决方案 > 使用 AWS Cognito 进行桌面身份验证

问题描述

经过一番战斗,我编写了一个测试桌面应用程序,允许用户使用 AWS Cognito 进行身份验证。我可以允许 AWS 处理身份验证、密码存储等。这解决了一些问题——为什么要重新发明轮子?

现在我的问题是我在应用程序中有各种需要细粒度权限的资源。如何使用 Cognito 控制对我的应用程序中非 AWS 资源的访问?

标签: amazon-web-servicesamazon-cognito

解决方案


我建议使用自定义属性,因为您提到了非 AWS 服务。创建一个名为 customer:role 的属性,其值为 ROLE_USER、ROLE_ADMIN 等。

https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html#user-pool-settings-custom-attributes

一旦他们在应用程序中通过身份验证,您就可以通过解码自定义属性来控制他们的权限。本教程更多地介绍了在 SAAS 多租户方法中使用 AWS 服务的权限。但是,我发现它非常有用,值得学习。

https://aws-quickstart.s3.amazonaws.com/saas-identity-cognito/doc/saas-identity-and-isolation-with-cognito-on-the-aws-cloud.pdf


推荐阅读