1
0

More than 3 years have passed since last update.

AWS Cognito Reactでサインアップ・サインイン機能を実装してみた

Posted at

初めに

入門中の React を使って Cognito のサインアップ・サインインのサンプルを作ってみました。

リポジトリは以下になります。

パッケージ

Cognito で認証機能を実装するには以下のパッケージが必要です。

npm install --save amazon-cognito-identity-js
npm install --save cross-fetch
import 'cross-fetch/polyfill';
import * as AmazonCognitoIdentity from 'amazon-cognito-identity-js';

使い方

必要なことは、以下のコードにユーザープール ID とクライアント ID を設定することです。

App.js
const poolData = {
  // setting ids
  UserPoolId: '',
  ClientId: ''
};

参考記事

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0