No description, website, or topics provided.
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
lib
.gitignore
LICENSE
Procfile
README.md
app.json
package.json

README.md

Bit6 Token Generator for Node.js

A super simple application demonstrating the external authentication in Bit6.

Prerequisites

Running Locally

$ git clone git@github.com:bit6/bit6-token-generator-node.git
$ cd bit6-token-generator-node
$ npm install

Specify your Bit6 API key and secret using environment variables or a local .env config file. The file should contain two lines:

BIT6_API_KEY=abc
BIT6_API_SECRET=xyz

Start the application

$ npm start

Your app should now be running on localhost:5000.

Deploying to Heroku

Make sure you have the Heroku Toolbelt installed.

$ heroku create
$ git push heroku master

or

Deploy to Heroku

Set Bit6 API key and secret:

$ heroku config:set BIT6_API_KEY=abc
$ heroku config:set BIT6_API_SECRET=xyz

Generating a Token

You would normally generate an external token by doing a POST from your app client to your application server. To simulate this using curl:

curl -X POST \
    -H "Content-Type: application/json" \
    -d '{"identities": ["usr:john","tel:+12123331234"]}' \
    http://localhost:5000/auth

The response should be a JSON object:

{
    "ext_token": "..."
}

Documentation

For more information about using Node.js on Heroku, see these Dev Center articles: