Socket
Socket
Sign inDemoInstall

passport-scope-restrict

Package Overview
Dependencies
5
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    passport-scope-restrict

Enforce authorization based on OAuth scopes set by Passport.js.


Version published
Maintainers
1
Install size
59.4 kB
Created

Readme

Source

passport-scope-restrict Build Status

Enforce authorization based on OAuth scopes set by Passport.js.

This is typically used to protect an API by requiring that the scopes associated with the client are allowed to call the API. Check out passport-http-bearer for one strategy you can build on to achieve this.

Examples

var express = require('express')
  , passport = require('passport')
  , restrict = require('passport-scope-restrict');

// setup your Express app, and configure Passport with some strategy which add `scopes` to `req.authInfo`.

app.use('/api/admin', restrict('admin'));

License

MIT. See LICENSE for details.

Keywords

FAQs

Last updated on 02 May 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