Skip to content

Latest commit

 

History

History
60 lines (53 loc) · 1.14 KB

README.md

File metadata and controls

60 lines (53 loc) · 1.14 KB

Parse Server Authy Adapter

Allows your Parse Server to authenticate users using Twilio Authy One-Time Passwords (OTPs)

Installation

  1. On your parse server config folder run npm install parse-server-authy-adapter

  2. Go to https://www.twilio.com/console/authy/applications/, get your API key.

  3. Follow the steps on the guide.

    {
    	.
    	.
    	.
    	auth: {
    		authy: {
    			module: 'parse-server-authy-adapter',
    			apiKey: 'your-api-key',
    		}
    	},
    }

Usage

  1. Follow Authy's instructions to receive an OTP

  2. 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": "..."
    }