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

@unvision/oauth2-server

v0.2.0

Published

OAuth 2.0, OpenID Connect and User-Managed Access 2.0 Authorization Server and Identity Provider.

Downloads

3

Readme

OAuth 2.0 Authorization Server

The OAuth 2.0 Authorization Server allows a web application to provide Authorization and Authentication to Clients based on the OAuth 2.0 Specification and its profiles OpenID Connect and User-Managed Access 2.0.

Integrations

This package is an implementation of the OAuth 2.0 Authorization Server in NodeJS + Typescript. It provides multiple layers of abstraction for various methods of integration with different frameworks, as well as different levels of control over the OAuth 2.0 Authorization Process.

Middlewares

The highest level of integration comes in the form of Middlewares for the various web frameworks of NodeJS. These middlewares only need a Configuration object and the implementation of the necessary Services.

The currently implemented Middlewares are:

  • [x] ExpressJS

Providers

The next level of integration comes in the form of Providers.

A Provider is an implementation of the AuthorizationServer abstract class for the various web frameworks of NodeJS. It has helper methods for creating OAuth 2.0 Requests based on the request object of the web framework and for parsing an OAuth 2.0 Response into the response object of the web framework. It can also provide custom properties or methods for the specific web framework, such as the ExpressJS Router in the ExpressProvider.

Providers need to be decorated with the AuthorizationServerMetadata decorator.

The currently implemented Providers are:

  • [x] ExpressJS

Authorization Server Abstract Class

The next level of integration is represented by the AuthorizationServer. It provides the barebones structure for a functioning implementation of the OAuth 2.0 Authorization Server by exposing the endpoints injected during its creation.

The AuthorizationServer class needs to be decorated with the AuthorizationServerMetadata decorator. This decorator receives an object containing the Configuration of the OAuth 2.0 Authorization Server and injects their implementations into the created instance.

Low level implementations

The last level of integration is defined as using the low-level implementations directly into your code.

Venturing into this level is a double-edged sword, since, on one hand, it provides a high level of freedom for customizing the behaviour of the OAuth 2.0 Authorization Server, but, on the other hand, it also means that there is a lot of room for misconfiguration, logic breaks and overall effort to put together all the pieces of the OAuth 2.0 Specification into one cohesive deployment.