0.1.11 • Published 9 years ago

anvil-connect-sdk v0.1.11

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

Node SDK for Anvil Connect

Anvil Connect aims to be a scalable, full-featured, ready-to-run OpenID Connect + OAuth 2.0 Provider. This package is a SDK for Nodejs client developers.

Install

$ npm install anvil-connect-sdk --save

Usage

Configuration example:

var anvil = require('anvil-connect-sdk');

anvil.configure({
  provider: {
    uri: 'https://your.authorization.server',
    key: '/path/to/public.key.pem'
  },
  client: {
    id: 'uuid',
    token: 'client.jwt.access.token'
  },
  params: {
    redirectUri: 'https://your.client.tld/callback'
  }
});

Protecting Services

Anvil Connect SDK includes Connect/Express/Restify compatible middleware for authenticating access tokens issued by Anvil Connect and enforcing authorization based on OAuth 2.0 scope.

This middleware can be used as route specific middleware...

var authorize = anvil.verify({ scope: 'research' });

server.post('/protected', authorize, function (req, res, next) {
  // handle the request
});

...or to protect the entire server:

server.use(anvil.verify({ scope: 'research' }));
0.1.11

9 years ago

0.1.10

9 years ago

0.1.9

9 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago