Skip to content

bit6/bit6-token-generator-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bit6 Token Generator for Node.js

A super simple application demonstrating the external authentication in Bit6.

Prerequisites

Running Locally

$ git clone [email protected]: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:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published