简体   繁体   中英

Create a user programmatically through the Admin role in AWS Cognito and Angular

I have an application using Spring Boot on the backend and Angular on the frontend. Now I have implemented a login screen via Amplify AWS in the frontend that accesses the Cognito user pool to authenticate my users. These have the roles of user and admin.

My goal now is to allow a manually created admin to add users via the frontend interface, which will then land directly in my Cognito user pool. Currently I have found a few approaches (AWS JS SDK, Lambda, AWS.CognitoIdentityServiceProvider API, amplify), but none straightforward that could solve my problem, as amplify doesn't seem to offer an option for creating users. How would you guys proceed to solve this problem as straightforward as possible? What are my next steps to achieve a programmatic solution for user creation via Angular frontend?

Thanks in advance.

This can be accomplished with the Cognito IDP APIs AdminCreateUser action it requires AWS credentials so it will either need to be implemented in the backend or you will need to get credentials for your user using cognito identity pool in the frontend.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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