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

node-dyalna-identity

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-dyalna-identity

Security Middleware for Dyalna identity server

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

Node Dyalna Identity

Security Middleware

Installation

  • npm install node-dyalna-identity

Usage

var identity = require('node-dyalna-identity');
var request = require('request-json');

var express = require('express');
var app = express();

// Add the security middleware
var identityHost = 'http://localhost:4000';
var identityToken = 'x-dyalna-auth-token';

app.use(new identity.security(request, identityHost, identityToken));

// Protected routes
app.get('/protected', new identity.authentication(), function(req, res) {
  console.log(req.security.authenticated); // outputs true
  console.log(req.security.token); // outputs the security token
  console.log(req.security.user); // outputs the user object
});

// Authorisation
app.get('/admin', new identity.authorization(['feature-admin']), function(req, res) {
  console.log('route only if the feature "feature-admin" is authorized');
});

FAQs

Package last updated on 18 Apr 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