Auth0 can passwordless(token based) authentication. but in default, SMS verification is used Twilio only. this solution is using auth0 custom connections, to possible SMS verification with AWS SNS and API Gateway.
-
create IAM Role
iam-sns-publishable-role
and attach inline policy.{ "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Action": [ "sns:Publish" ], "Resource": [ "*" ] } ] }
-
change
iam-sns-publishable-role
trust relationalship to ↓
you changeService
property to "apigateway.amazonaws.com"{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "apigateway.amazonaws.com" }, "Action": "sts:AssumeRole" } ] }
-
Import
swagger.json
to your API Gateway. and you replaceYOUR_ACCOUNT_ID
inswagger.json
l.52 (if you changeiam-sns-publishable-role
name, change too) -
Deploy API Resources->Actions->Deploy API, parameter is ↓
key value Deployment Stage [New Stage] Stage name latest -
Create custom SMS Passwordless Connection in Auth0 using Auth0 API Explorer. required Scope
create:connections
(better to haveupdate:connections
,read:connections
) -
Enable Connection in Auth0 Console. Connections->Passwordless->SMS -> Enable Your Apps(in Default,
Default App
) -> Try Passwordless Auth -
Congratulations!!! 🍻