Cognito
#AWS
初期設定
https://docs.aws.amazon.com/ja_jp/cognito/latest/developerguide/user-pool-settings-attributes.html#user-pool-settings-aliases
https://dev.classmethod.jp/articles/cognito-oidc-how-to-setup/#toc-4
サインアップ方式は変更できない
ユーザーはユーザー名を使用してサインアップし、ユーザー名またはエイリアスを使用してサインインする
ユーザー名とemailアドレスでのサインインを許可する
オプション 2: ユーザーはユーザー名の代わりに E メールまたは電話番号を使用してサインアップおよびサインインする
Emailアドレスをユーザー名としてサインインする。
cognito ad
https://aws.amazon.com/jp/blogs/mobile/building-adfs-federation-for-your-web-app-using-amazon-cognito-user-pools/
料金
https://aws.amazon.com/jp/cognito/pricing/
Cognito Advanced Security
最初の 50,000 0.050USD
フェデレーションの場合OIDC
50 MAUまで無料
0.015USD / 1MAU
150 USD / 1万 MAU
アドバンストセキュリティのメトリクスの表示 - Amazon Cognito
$500 / 1万MAU
MFA使用できる
別途料金
アカウント回復可能
attribute
read ,write 権限指定可能
https://docs.aws.amazon.com/ja_jp/cognito/latest/developerguide/user-pool-settings-attributes.html
書き込み不可はバックグラウンドプロセスでアップデート可能みたい
getting started
https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-getting-started.html
https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-scenarios.html
Authenticate with a User Pool
You can enable your users to authenticate with a user pool. Your app users can sign in either directly through a user pool, or federate through a third-party identity provider (IdP). The user pool manages the overhead of handling the tokens that are returned from social sign-in through Facebook, Google, Amazon, and Apple, and from OpenID Connect (OIDC) and SAML IdPs.
API レファレンス
ChangePassword
UpdateUserAttributes
https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_UpdateUserAttributes.html
サインアップ例
https://www.tdi.co.jp/miso/amazon-cognito-sign-up
https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html
連携
アプリ統合
ドメインの設定がある。OAuthの設定の際、必要
ユーザープールにアドバンスドセキュリティを追加する
追加料金発生
普段とは異なるアクセスの通知
メールアドレスの変更
https://kohei1116.hateblo.jp/entry/2020/02/16/aws-cognito
https://zenn.dev/dove/articles/78ecf08b51ee0c
認証されていないのに、メールアドレスが変更されてしまう!?
許可されたOAuthフロー
https://docs.aws.amazon.com/ja_jp/cognito/latest/developerguide/cognito-user-pools-app-idp-settings.html
Authorization code grantフローは、コード付与フローを開始します。これは、レスポンスとして認証コードを提供します。このコードは「」を使用してアクセストークンと交換できます。トークンエンドポイント. トークンはエンドユーザーに直接公開されないため、侵害される可能性は低くなります。
Cognito Cli
List users
https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/list-users.html
これで他のDBへの移行が可能そう。
subとメールアドレスを取得する。