首页 > 解决方案 > (在哪里)在 Angular 8 应用程序中创建 AWS CognitoUserPool

问题描述

从 AWS Cognito 文档:

https://aws.amazon.com/blogs/mobile/accessing-your-user-pools-using-the-amazon-cognito-identity-sdk-for-javascript/

AWSCognito.config.region = 'us-east-1';

var poolData = {
    UserPoolId : '...', // your user pool id here
    ClientId : '...' // your client id here
};
var userPool = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool(poolData);
var userData = {
    Username : '...', // your username here
    Pool : userPool
};

但是我不知道哪个文件/在哪里/何时创建我的 userPool 实例。

在 app.component.ts 中这样做对我来说是有意义的,但我不确定这是否正确。

我也不明白我AWSCognito从哪里导入函数,我找不到合适的库来执行此操作。

感谢您的任何帮助。

标签: angularauthenticationamazon-cognitoaws-userpools

解决方案


推荐阅读