はじめに 社内で構築したWEBアプリを社外のユーザーにも使ってもらう際に、ユーザー認証部分を従来は node.js+express+passport で構築していました。 この方式の場合、ユーザーの追加変更削除を行うにはユーザーを管理するデータベースを直接触るか、または別途ユーザー管理画面を作成する必要があり手間がかかっていました。 今回この認証とユーザー管理部分をAWSのCognitoに移行したので手順を共有します。 なお、このサンプルではローカルPCにWEBアプリおよびリバースプロキシをサーバー構築するものとします。 Amazon Cognitoの設定 ユーザープールの作成 AWSにログインしてサービスの一覧から Cognito をクリックし、次画面で[ユーザープールを作成]ボタンをクリックします。 Cognitoユーザーのサインインオプションは「Eメール」のみ選択します。 セキュリテ