Socket
Socket
Sign inDemoInstall

passport-strategy

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-strategy

An abstract class implementing Passport's strategy API.


Version published
Maintainers
1
Weekly downloads
2,107,266
decreased by-8.87%

Weekly downloads

Readme

Source

passport-strategy

Build Coverage Dependencies

An abstract class implementing Passport's strategy API.

Install

$ npm install passport-strategy

Usage

This module exports an abstract Strategy class that is intended to be subclassed when implementing concrete authentication strategies. Once implemented, such strategies can be used by applications that utilize Passport middleware for authentication.

Subclass Strategy

Create a new CustomStrategy constructor which inherits from Strategy:

var util = require('util')
  , Strategy = require('passport-strategy');

function CustomStrategy(...) {
  Strategy.call(this);
}

util.inherits(CustomStrategy, Strategy);
Implement Authentication

Implement autheticate(), performing the necessary operations required by the authentication scheme or protocol being implemented.

CustomStrategy.prototype.authenticate = function(req, options) {
  // TODO: authenticate request
}

Tests

$ npm install
$ npm test

Credits

License

The MIT License

Copyright (c) 2011-2013 Jared Hanson <http://jaredhanson.net/>

Keywords

FAQs

Last updated on 01 Aug 2013

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc