parse-server-authy-adapter
v1.0.2
Published
Adapter for authy OTP authentication
Downloads
6
Readme
Parse Server Authy Adapter
Allows your Parse Server to authenticate users using Twilio Authy One-Time Passwords (OTPs)
Installation
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', } }, }
Usage
Follow Authy's instructions to receive a 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": "..." }