さわらブログ

さわら(@xhiroga)の技術ブログ

ググって出てきたCognito UserPoolのベストプラクティスを雑にまとめる

(このブログは、 #技術書典7 で出展する「Cognito屋さん/ Cognito ユーザー移行入門(仮)」の下調べのために書いてます.)

タイトル通り、ググって出てきたCognito UserPoolのベストプラクティスを雑にまとめていきます。

Security / Best Practice for poolData (UserPoolId, ClientId) in a browser JS app

github.com

UserPoolIDとClientIDは、JSのコード内で公開していいの?という質問。
スレッドにある通り、これらの値は unauthenticated APIs のリクエストにしか使われないので大丈夫。

Cognito user pools, in my experience, are terrible to work with

www.reddit.com

ベストプラクティスじゃないけど...Cognito使うのしんどいよね、って話。
いっそ新しいサービス出したらいいんじゃない?って指摘には私も同意。
Cognito is a flawed product that should become redundant. AWS should either build a new service with a new name or build a backwards incompatible Cognito 2.0.

[レポート] サーバーレスアーキテクチャデザインパターンとベストプラクティス! #reinvent #ARC305

dev.classmethod.jp

たしかに、Cognito使いたい人ってAPI Gatewayを認証付きで提供したい人だよね。
1.一時的なAWS認証 or 2.UserPoolのトークン or 3.Lambdaオーソライザー。特に 1.と2. は混同しやすいのでは?

HOW TO USE NEW ADVANCED SECURITY FEATURES FOR AMAZON COGNITO USER POOLS

noise.getoto.net

せっかくだしMFAもちょっと触ってから本を書いたほうがいい気がしてきた

SaaS Identity and Isolation with Amazon Cognito on the AWS Cloud

https://aws-quickstart.s3.amazonaws.com/saas-identity-cognito/doc/saas-identity-and-isolation-with-cognito-on-the-aws-cloud.pdf

弊社(justInCase)のアーキテクチャじゃんこれ!!!知らずしてここにたどり着いたんだなあ...
CloudMapを使ってるとこだけが違う。

Are email addresses supposed to be case-sensitive?

https://forums.aws.amazon.com/forum.jspa?forumID=173&start=0

そうそう、メアドが大文字小文字違いで登録できちゃうんだよね。