问题标签 [aws-userpools]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
3390 浏览

amazon-web-services - 配置 Cognito 用户池以使用 SES 发送电子邮件

今天早上,我注意到我的用户池设置中有一个我以前没有注意到的警报:

在此处输入图像描述

我查看了设置屏幕,有一个单选按钮:

在此处输入图像描述

我已经有一个发件人地址。如何使用 CloudFormation 将该设置设置为是?

Cognito CloudFormation 文档如下所示:

EmailConfiguration 是我设置发件人地址的地方,我想也许他们在那里添加了它,但EmailConfiguration 文档似乎也没有任何内容。

知道如何配置 Cognito 用户池以将 SES 用于电子邮件吗?

0 投票
1 回答
242 浏览

facebook - 如何将 Facebook 帐户附加到 AWS Cognito 用户

我在 Cognito 用户池中有一组用户。这些用户,并且只有这些用户,被允许登录到我的 web 应用程序。

现在我想允许这些用户,并且只有这些用户,可以选择通过 Facebook 或通过他们的登录凭据登录。换句话说,我想允许一个人使用 Facebook 或他们的 Cognito 登录凭据登录我的应用程序,并访问相同的 Cognito 用户帐户,无论他们是使用 FB 还是 Cognito 登录。需要说明的是,不允许没有 Cognito 用户帐户的 FB 用户登录我的应用程序。我该怎么做呢?这可能吗?在我看来,我必须找到一种方法将每个 Cognito 用户的 Cognito 用户池帐户与其相应的 Facebook 帐户映射。

从 AWS 上的 Cognito 文档看来,当我将 Facebook 添加为联合身份提供商时,这意味着用户可以通过 Cognito 或 Facebook 登录,并且所有可以登录 Facebook 的 Facebook 用户现在都可以登录我的应用程序。这不是我想要的!仅仅因为一个人被授权使用 Facebook 并不意味着他们被授权使用我的应用程序!

那么,如何允许我的 Cognito 用户池中的用户连接他/她的 Facebook 帐户,以便用户有多种方式登录到同一个 Cognito 用户帐户?

0 投票
1 回答
946 浏览

amazon-web-services - 我们可以创建带有放大功能的 aws cognito 用户池身份验证以响应本机(没有博览会)吗?

他们在文档中提到了两种方法,

https://github.com/aws-amplify/amplify-js/wiki/FAQ#how-can-i-get-jwt-token-when-using-amplify-to-get-federated-users-login

所以根据这个 userpool 可以在我们使用托管 ui 时与社交登录一起使用,使用相同的函数 Auth.federatedSignIn()

当我尝试这个例子时(上面的例子#note for expo users), https ://aws-amplify.github.io/docs/js/authentication#a-note-for-expo-users 它给出了错误 - cognito.urlOpener是未定义的。但我在这里找到了解决方案 - 更新 aws amplify 库

https://github.com/aws-amplify/amplify-js/issues/3000#issuecomment-479880086

当前库版本 - aws-amplify - 1.1.24-unstable.0 ,aws amplify react native - 2.1.9

但是当我更新这些应用程序不起作用 - 它给出了错误undefined variable Symbol

有人请让我知道我们是否可以使用 cognito 用户池通过 aws amplify 社交登录来响应本机应用程序。

谢谢

0 投票
2 回答
1027 浏览

amazon-web-services - 无服务器在已经存在时不断尝试创建用户池域

我有一个配置到我的 serverless.yml 的 aws cognito 用户组。每当我进行无服务器部署时,即使它已经存在,它也会尝试创建相同的用户池域,因此返回以下错误:

唯一的解决方法是每次我想从 AWS UI 进行无服务器部署时删除用户池域。以前有人遇到过这个问题吗?

0 投票
0 回答
4184 浏览

amazon-web-services - AWS cognito AUTHORIZATION Endpoint 返回错误请求 (400)

我喜欢使用用户池的Authorization-endpoint端点向 facebook 进行身份验证。

用户池的联合 Facebook 身份池的 aws incognito授权端点返回状态 400 错误请求。错误负载中没有更多细节,只有一些 HTML。我怎样才能获得有关出了什么问题的更多详细信息?

用法:

AppClient的配置: 在此处输入图像描述

0 投票
1 回答
1899 浏览

ios - 如何修复 AWSCognito 代码中的“domainnsposixerrordomain code13 权限被拒绝”运行时错误?

我收到一个运行时错误,上面写着:

[NetworkInfo] 信号强度查询返回错误:Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied",描述符:

在我的代码中声明了变量“task”。我用注释标记了生成错误的行。

以下是打印语句的调试窗口中的结果:

任务=

注册响应=无

用户=无

我在 AWS Cognito 控制台中检查了我的用户池。这一切都检查出来。我提供了用户池所需的所有必要信息。

这是游泳池的屏幕截图:

在此处输入图像描述

这个错误的原因是什么,我需要研究什么才能修复它?

0 投票
1 回答
309 浏览

amazon-web-services - If using multiple UserPool's "App clients", do I need to add them all to IdentityPool's "Authentication providers"?

I'm writing a web app which is using AWS Cognito UserPools for user authentication and IdentityPools for granting direct access to an S3 bucket.

This JavaScript web app has its own App client ID in the UserPool with which it interacts with it.

I also have a couple of Lambda functions doing some admin functions towards the UserPool and IdentityPool. These lambda functions have their own App client ID.

I used to have only a single Authentication provider added to the IdentityPool, with the same App Client ID that the lambda functions have set.

In this setup, the web app was having issues. I was able to authenticate towards the UserPool, but when the identity token was sent to the IdentityPool, I received an error "Token is not from a supported provider of this identity pool.". I believe this was because the aud parameter of the JWT was set to the UserPool ID which was not added to the IdentityPool

I eventually realized that I could get rid of the error if I added another "Authentication provider" to the IdentityPool, filling in the same UserPool ID and the other App client ID.

My question now is - is this the correct approach? Am I perhaps misunderstanding the App client ID meaning and usage? Am I way off base with my approach?

0 投票
1 回答
413 浏览

android - 在 Android 上使用 Cognito 用户池身份验证为 AWS AppSync 更正 Proguard 规则

我有一个使用具有以下 gradle 配置的 AWS AppSync SDK 连接到云后端的 Android 应用程序。

通过 Cognito 用户池控制对后端资源的访问。在没有启用 proguard 的情况下,用户身份验证和从后端获取数据可以正常工作。如果我启用 Proguard,我会收到与 AWS 开发工具包相关的各种警告。我设法生成启用 proguard 的签名 APK 的唯一方法是在 proguard-rules.pro 中抑制所有与 AWS 相关的警告,如下所示:

-dontwarn com.amazonaws.**

当我这样做时,生成的 APK 不会对用户进行身份验证,并且无法从后端检索数据。当我尝试调试 APK 时,我在 Android Studio 中收到以下错误:

是否有更细粒度的 proguard 设置可以消除所有警告但不会破坏与后端的连接?

0 投票
1 回答
180 浏览

angular - 通过谷歌联合身份登录用户池后自动将用户添加到 AWS 身份池?

我正在构建一个使用 AWS Cognito 托管身份验证安全性的 Web 应用程序。我让用户通过谷歌登录页面登录,然后将该登录实例自动添加到配置的 AWS 用户池中。我正在通过此端点执行此操作:

https://your_domain/login?response_type=token&client_id=your_app_client_id&redirect_uri=your_callback_url

并得到如下回复:

https://www.example.com/#id_token=123456789tokens123456789&expires_in=3600&token_type=Bearer

我如何使用它来自动将用户添加到配置的 AWS 身份池?然后,我是否可以从身份池取回允许访问 S3 和 DynamoDB 等服务的凭据,如果是,我该怎么做?

该文档非常混乱,任何帮助将不胜感激。

0 投票
1 回答
728 浏览

amazon-web-services - AWS Cognito:使用 lambda 函数将用户限制为单个域 - 接收错误

我有一个 AWS Cognito 用户池,用于在带有amplify auth. 我想限制从我公司的域登录 Google 帐户,因此我创建了一个自定义 lambda 函数(如下)并将其配置为我的用户池的 AWS 控制台中的预身份验证触发器:

触发器正确地允许公司帐户登录,但如果有人尝试使用非公司帐户登录,则应用程序会引发错误并崩溃:

我的 lambda 函数有什么问题?看起来,当它返回带有错误的回调时,应用程序代码没有处理该错误,但我不知道为什么。