npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bluehalo/sof-strategy

v1.1.6

Published

Smart on FHIR authorization strategy for passport

Downloads

11

Readme

SOF-Strategy

Strategy for Smart on FHIR authentication that works with Passport like any other passport strategy.

Install

yarn add @bluehalo/sof-strategy

Usage

// Returns a helper function to setup your strategy
const smartBearerStrategy = require('@bluehalo/sof-strategy');
const passport = require('passport');

// Create our strategy by giving it some config options, all are required
let strategy = smartBearerStrategy({
  introspectionUrl: 'https://www.foo.com/introspection',
  clientSecret: 'secret',
  clientId: 'client',
});

// Configure passport to use this new strategy
passport.use(strategy);

// Integrate it into your routes via middleware or some other mechanism
// Our strategy is a bearer strategy so use bearer for the name
let name = 'bearer';
let options = { session: false };

// Use as middleware use case
// app is a express instance
app.use('/some/protected/route/', passport.authenticate(name, options), someRouteController);

See sof-strategy tests for more usage examples.

Arguments

@bluehalo/sof-strategy exports a single function which takes a single options argument with the following properties.

introspectionUrl

Introspection endpoint. The strategy will attempt to make a request to this endpoint with a token(provided by passport.js), clientId, clientSecret to validate the token has not been modified or resigned.

Type: String
Required: true

clientSecret

Necessary to validate the bearer token. Do not store these in client side code no matter what. This module should only be used server-side.

Type: String
Required: true

clientId

Necessary to validate the bearer token. Do not store these in client side code no matter what. This module should only be used server-side.

Type: String
Required: true