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

serverless-oidc-provider

v0.1.0

Published

Starter kit for providing OpenID Provider(OP) with serverless architectures using AWS Lambda.

Downloads

2

Readme

serverless-oidc-provider

Starter kit for providing OpenID Provider(OP) with serverless architectures using AWS Lambda.

Overview

Base project of providing OpenID Provider (OP) quickly with Serverless architecture.
You do not need to implement the mechanism of user authentication and data persistence yourself.
Use node-oidc-provider to provide necessary functions as OpenID Provider(OP), and it is highly customizable.
By using Serverless Framework built in the project, you can deploy applications easily and quickly.

Usage

Preparation

DynamoDB

Create a table of DynamoDB with id as HashKey.

Cognito User Pool

If it does not exist, or if you want to use a new user pool, create a Cognito User Pool.
Add an application client that enabled ADMIN_NO_SRP_AUTH to the created User Pool.

Notice
User management is out of scope. Please manage users with console and various SDK.

Setup

Clone Project

$ git clone [email protected]:AKIRA-MIYAKE/serverless-oidc-provider.git
$ cd serverless-oidc-provider

Prepare .env

cp .env.sample .env

Update the following items with your values.

  • OIDC_ISSURE
    • URL using the https scheme with no query or fragment component that the OP asserts as its Issuer Identifier.
  • SECURE_KEYS
    • Signed cookie keys for koa app.
  • AWS_ACCOUNT_ID
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_DEFAULT_REGION
  • AWS_DYNAMODB_TABLE_NAME
    • Name of table created in preparation.
  • AWS_COGNITO_USER_POOL_ID
    • Id of User Pool created in preparation.
  • AWS_COGNITO_USER_POOL_CLIENT_ID
    • Id of Client of User Pool created in preparation.

Setup Docker image

$ ENV_FILE=.env docker-compose build

npm install

$ ENV_FILE=.env docker-compose run --rm serverless npm install

Generate Keystore

$ ENV_FILE=.env docker-compose run --rm serverless npm run generate-keys

Configuration

The basic settings are defined in the src/app/oidc/setting.js. Change according to the situation.
For details, check node-oidc-provider: Configuration.

The interaction sample is defined in the src/app/oidc/actions/interaction.js and src/app/oidc/views. Please customize the views etc.

The setting of AWS is src/services/oidc-provider/serverless.yml. Change each item if necessary.

Deploy

$ ENV_FILE=.env docker-compose run --rm serverless npm run deploy

Custom Authorizer

This project provide sample lambda function for use with Custom Authorizer of API Gateway on src/services/authorize.
It is a Custom Authorizer that uses introspection endpoint of RFC7662: OAuth 2.0 Token Introspection.
Of course, you can also use the introspection endpoint provided by node-oidc-provider.
Please see src/app/authorize for details.
And, src/services/sample is a sample of APIs protected by that Custom Authorizer.