(Where to) Create AWS CognitoUserPool in an Angular 8 application

痴心易碎 提交于 2020-04-17 20:23:16

问题


From the AWS Cognito documents:

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
};

However I do not know which file / where / when to create my instance of the userPool.

It makes sense for me to do it in the app.component.ts, but I am unsure if this is right.

I also don't understand where I import the AWSCognito function from, I cannot find the right library to do this.

Thank you for any help.

来源:https://stackoverflow.com/questions/60101611/where-to-create-aws-cognitouserpool-in-an-angular-8-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!