We also added a couple of examples on how to add J...
# general
j
a
Do we have an example of a lambda authorizer with API Gateway and then a custom JWT auth service in an sst app, I have been unable to find something like this. My challenge is I want to resort to passwordless login using mobile number and OTP, sadly, cognito doesn’t provide that out of the box.
j
Oh hmm I'm not sure if I've seen that. But adding support for a Lambda authorizer is on our roadmap.
a
This would technically be a part of the auth construct, right? Could you give me some ideas as to how I could go about implementing this?
f
@Ashishkumar Pandey I think you don’t need Lambda authorizer for this. Cognito User Pool supports passwordless login https://aws.amazon.com/blogs/mobile/implementing-passwordless-email-authentication-with-amazon-cognito/
a
Huh! Wow, okay, I'll go through this, thank you for your guidance. 🙌
f
Yeah, so you have to decide if you want to use JWT or IAM to protect ur API
But in both cases, you would have to create a
cognito.UserPool
construct in CDK
a
Awesome! Haha, thank you, this is awesome. I'll attempt these examples. Hopefully, it works out.
f
Cool. Lemme know if you have any questions.
a
Do I need a cdk construct or can I use the auth sst construct to achieve the same.
f
You need to create the User Pool in cdk construct. And then you can pass it in to the
sst.Auth
construct if you are going to use IAM. Or pass it in to the
sst.Api
construct’s authorizer if you are going to use JWT.
a
Okay, understood. Thank you.
r
This is awesome, thank you for adding this so quickly.