简体   繁体   中英

How do I migrate users from RDS mysql databse to aws cognito user pools?

我有一个 ios 应用程序,当一个人登录时,uath 通过 cognito(就位)发生,此外,由于我的所有用户数据都在 rds mysql 中,我还希望它检查用户的电子邮件 ID 是否存在在 rds mysql db 中与否。为此,我想创建一个用户迁移 lambda 触发器。请告诉我我的架构是否有意义?

There are multiple questions in a single question but I will answer anyway:

How do you migrate users? You could just create a single-execution task to migrate your users from your MySQL db to Cognito, the only and biggest problem... could be the password info, I assume that you do not have it on plain text.

You could just send an email to all users about updating their password and give them a unique link to do so.

Another option is to keep that db and table for the users, when a new user logs in, just create/add the user to cognito with the password provided.

I assume that you might have this flow right now:

  1. User logins with user/password
  2. Server authenticates password and user to be on MySQL (password should not be in plain text) and returns the user info.

so, you could change it to be:

  1. User logins with user/password
  2. Server authenticates on cognito, if failed:
  3. Server authenticates password and user to be on MySQL
  4. Server adds user on cognito
  5. Return user info

And in ... 3 months? or something, you could just drop the DB since you already have most users in cognito.

Answering the about architecture question:

I dont have enough context but seems complicated, why are you changing to cognito, any preference or feature that you want to use?

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