Amazon Cognitoで発行済みの仮パスワードの有効期限を延長できますか?

0

既存システムからAmazon Cognitoにユーザーを移行するためにAdminCreateUser API を使って1000件強のユーザーを新規作成しました。しかし半分以上のユーザーが仮パスワードの有効期限(7日)以内にサインインを行わなかったため、それらのユーザーはFORCE_CHANGE_PASSWORD状態のままになっています。

これらのユーザーにパスワードの再発行メールを再度送信することは避けたいのですが、発行済みの仮パスワードの有効期限を延長する方法はありますか?

Yuki
asked 8 months ago692 views
2 Answers
1
Accepted Answer

こちらのドキュメントを見るとupdate-user-poolで変更が出来そうです。
https://docs.aws.amazon.com/ja_jp/cognito/latest/developerguide/user-pool-settings-admin-create-user-policy.html

ただし、期限切れの場合は無理かもしれないのでその場合はステータスが「FORCE_CHANGE_PASSWORD」になっているユーザーを取得してadmin-create-userを実行する必要があると思います。
今回ユーザー数が多いということなのでAWS CLIやSDKなどを使用してスクリプトを作成することをお勧めします。
https://dev.classmethod.jp/articles/allow-to-reset-expired-cognito-user-password/

profile picture
EXPERT
answered 8 months ago
0

ありがとうございます。期限切れのパスワードを再有効化することは出来なさそうだったので、期限切れユーザーに対してadmin-create-userをパラメータMessageAction='RESEND'を指定してコールするスクリプトを作成することにします。

参考:https://stackoverflow.com/questions/51109154/how-do-i-reset-a-cognito-users-password-that-has-expired

ご回答ありがとうございました。

Yuki
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions