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

dnt-connect

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dnt-connect

Node.JS library for DNT's single sign on service DNT Connect

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Weekly downloads
 
Created
Source

DNT Connect Build Status

Node.JS library for DNT's single sign on service – DNT Connect

Requirements

Require Node.JS version >= 0.10.

Install

npm install dnt-connect --save

Usage

var Connect = require('dnt-connect');

New Client

var client = new Connect('myClientName', 'mySecretKey');

Bounce

Bounce is used to check if a user is currently authenticated with DNT Connect. The bounce url will bounce the user automaticly back to the provided redirect_url with user data if the user is authenticated.

var url = client.bounce('http://mysite.com/auth')

Signon

Signon is used to require a user to sign in with their DNT Connect user or register a new user. The user credentials will be sent to the redirect_url when the users is sucessfully authenticated.

var url = client.signon('http://mysite.com/auth')

Decrypt Response

All data sent and recieved to and from DNT Connect is encrypted by 256 bit AES cipher in CBC mode. In order to read recieved data from DNT Connect your application needs to call #decrypt() wich will use your privat DNT Connect API key to decrypt and verify the data.

NB The return from the #decrypt() method is an Array with two elements in it; data and valid. The reason for this is because of Destructing assignments, new in ECMAScript 6.

try {
  var data = client.decrypt({data: queryData, hmac: queryHmac});
  if (data[1] is false) {
    console.log('Validation failed');
  } else {
    console.log('Decrypted data');
    console.log(data[0]);
  }
} catch (e) {
  // Decryption or serialization failed
}

The MIT License (MIT)

Copyright (c) 2014 Turistforeningen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

Package last updated on 02 May 2014

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