Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mediahead-token

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mediahead-token

Token Generator and Verifier for Mediahead

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Mediahead Token

npm version Code Climate Test Coverage Build Status

Mediahead Token is meant to create Authorization between our own Applications.

With this Library we can generate a Token on Server 1 and verify it on Server 2.

Configuration

There are three Environement Variables, which can be set:

  • MEDIAHEAD_TOKEN_SECRET - Set the Secret. It has to be the same on every Application, otherwise this won't validate.
  • MEDIAHEAD_TOKEN_MAXAGE - Set the Max Age of a Token in seconds. Defaults to 60 seconds.
  • MEDIAHEAD_TOKEN_IDENTIFIER - Default Identifier for Token generation.

Instalation

Install the Package

$ npm install git@bitbucket.org:mediahed/mediahead-token.git --save

In your Code

var token = require('mediahead-token');

Usage

Generate a new Token

// If you don't have MEDIAHEAD_TOKEN_IDENTIFIER set
var generatedToken = token.createToken('identifier');
// else
var generatedToken = token.createToken();

Validate a Token

var tokenToValidate = new Token('$token$4123412$dfahdafhgdafg$');
var valid = tokenToValidate.validate();

Keywords

FAQs

Package last updated on 09 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc