A POC demonstrating how to create passwordless authentication system using AWS Cognito, Lambda and the Serverless framework.
The repository has two parts:
- the
backend
developed with serverless, aws and typescript and - the
client
developed using react and typescript bootstrapped with vite.
git clone [email protected]:Collaborne/aws-serverless-cognito-passwordless-auth-poc.git
cd aws-serverless-cognito-passwordless-auth-poc
cd backend
npm install
- Open the
serverless.yml
file - Set your values for:
- provider.profile (serverlessUser)
- provider.region
- custom.emailFrom
npm run build
npx serverless deploy
- Run
npx sls info --verbose
to get the values ofUserPoolClientId
,UserPoolId
andServiceEndpoint
(You will need these for the client).
cd client
npm install
- Create a
.env
from the.env.example
template - Set the values of
VITE_REGION
,VITE_USER_POOL_ID
andVITE_USER_POOL_WEB_CLIENT_ID
(These are the values you get from step 4 above).
npm run dev
- In a browser, open the sign up page at
http://localhost:5173/sign-up
and you can sign in fromhttp://localhost:5173/sign-in
The authentication process is not secured since only an email is required to register and login. The implication of this is that any email can be used to register and the knowledge of someone's email can get me access to their account (since emails are not private entities).
There should be a limit of operations that can be performed by users with this type of authentication. Deleting and Editing should be restricted to users with more secure authentication methods.