繁体   English   中英

如何授予AWS Cognito用户池访问权限以对AWS资源(SES)执行操作

[英]How do I give an AWS Cognito Userpool Access to perform an action on an AWS Resource (SES)

我正在使用AWS Cognito对我的应用程序中的用户进行身份验证。 AWS在其文档中说,已登录用户的凭证可用于授予对AWS资源的访问权限。

我想使用SES允许用户从应用程序内提交联系我们表格。

我能够获得用户凭据。 但是,当我将它们用于AmazonSimpleEmailServiceClient并调用sendEmail() ,出现以下异常:

com.amazonaws.AmazonServiceException:用户arn:aws:sts::xxxxxx/CognitoIdentityCredentials' is not authorized to perform对资源`arn:aws:ses:xxxxxx' arn:aws:sts::xxxxxx/CognitoIdentityCredentials' is not authorized to perform ses:SendEmail(服务:AmazonSimpleEmailService;状态代码:403;错误代码:AccessDenied;请求ID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

如何允许Cognito用户池调用sendEmail()这样我就不需要在应用程序代码中存储任何机密了?

为了向用户提供AWS资源的访问权限,除了Cognito用户池外,还需要设置Cognito联合身份。

在Cognito联合身份中,连接相关的Cognito Userpool并为经过身份验证的用户创建IAM角色策略,以包括AWS SES访问。

暂无
暂无

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

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