Allows your Parse Server to authenticate users using Twilio Authy One-Time Passwords (OTPs)
-
On your parse server config folder run
npm install parse-server-authy-adapter
-
Go to https://www.twilio.com/console/authy/applications/, get your API key.
-
Follow the steps on the guide.
{ . . . auth: { authy: { module: 'parse-server-authy-adapter', apiKey: 'your-api-key', } }, }
-
Follow Authy's instructions to receive an OTP
-
POST
to/users
on parse-server the following payload{ "authData": { "authy": { "id": "authy-user-id", "otp": "one-time-password" } } }
Curl example:
curl -X POST -H "Content-Type: application/json" \ -H "X-Parse-Application-Id: myAppId" -d '{ \ "authData": { \ "authy": { \ "id": "authy-id", \ "otp": "authy-otp" \ } \ } \ }' "http://example.com/parse/users"
Response:
{ "objectId": "...", "createdAt": "...", "username": "...", "sessionToken": "..." }