1.0.0 • Published 4 years ago

bbjwt-client v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

bbjwt-client

This module is used to authenticate JSON Web Tokens created by the BombBomb API in NodeJS services.

Install this module into your project with npm install bbjwt-client --save.

As of v0.5.3 support new OAuth2 tokens, see http://developer.bombbomb.com/auth/

var token = req.headers.authorization; // or however you intake your token

var bbjwt = require("bbjwt-client");
bbjwt.getClientIdFromToken(token,function(err, clientId){
    if (err)
    {
        console.error("Bad Token " + err);
    }
    else
    {
        console.log("The trusted clientId is: " + clientId);
    }
});

Prior to v0.5.2 You then include it in your project like so:

var token = req.headers.jwt; // or however you intake your token

var bbjwt = require("bbjwt-client");
var clientId = bbjwt.getClientIdFromToken(token);
// clientId will be false if the token doesn't check out
if (clientId==false)
{
  returnError(res, "Bad Token!");
}
console.log("The trusted clientId is: " + clientId);

You must to provide the shared secret for signature validation by setting the environment variable JWT_SECRET.

Get a token by making an authenticated call to https://app.bombbomb.com/app/api/api.php?method=GetJsonWebToken

1.0.0

4 years ago

1.0.0-beta.0

4 years ago

0.6.0

4 years ago

0.5.7

6 years ago

0.5.6

6 years ago

0.5.5

7 years ago

0.5.4

7 years ago

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.1.3

7 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago