This repository is about example code for creating Amazon Cognito user via kakaotalk signin
Deploying this cdk will provision below architeture on you AWS Account.
- awscli
- Nodejs 10.x+
- Python 3.4+
- AWS Account and Locally configured AWS credential
this repository consists of 2 parts
- infra - provision AWS resources such as Cognito UserPool, ApiGateway, etc.
- web - run Nextjs web service on locally to test Kakao signin
Install project dependencies
$ cd infra
$ npm i
Install cdk in global context and run cdk init
if you did not initailize cdk yet.
$ npm i -g cdk@1.119.0
$ cdk bootstrap
Deploy CDK Stacks on AWS
$ cdk deploy "*" --require-approval never
- visit Kakao Developer Console and create your app
Cognito requires user email to register user, so you should add email to scope on Kakao Login
- register web platform url with
http://localhost:3000
- enable
Kakao Login
and set redirect uri withhttp://localhost:3000
-
copy
Javascript Key
on your app summary page -
open config.ts and edit below variables:
- AmplifyConfig.UserPoolId - check out console or output of
cdk deploy
at infra - AmplifyConfig.UserPoolWebClientId - check out console or output of
cdk deploy
at infra - ApiHash - check out console or output of
cdk deploy
at infra - IdentityProvider.Kakao.AppKey - paste
Javascript Key
at Kakao Developer Console
- Install dependencies
$ cd web
$ npm i
- run dev server
$ cd web
$ npm run dev
-
visit http://localhost:3000 and click kakao login button
-
login at redirected kakako page
-
alert should be displayed
-
visit Amazon Cognito UserPool console page
-
user and group should be created
destroy provisioned cloud resources
$ cd infra
$ cdk destroy "*"