Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abouslimi/koa-openid-client

OpenID client for KOA framework.
https://github.com/abouslimi/koa-openid-client

auth auth0 authentication authorization koa koa2 koajs middleware openid openid-client openid-connect

Last synced: 30 days ago
JSON representation

OpenID client for KOA framework.

Awesome Lists containing this project

README

        

# KOA OpenID Client

## Overview

The library supports:
- Authorization using `Code` Flow.
- `Auth0`

## Install

Install with npm:
```bash
npm i --save koa-openid-client
```

## Usage

```javascript
import KoaOpenID from "koa-openid-client";
```

```javascript
const openid = new KoaOpenID({
auth_required: true,
base_uri: "",
issuer_base_uri: "https://.auth0.com/",
scope: "openid profile email",
client_id: "",
client_secret: "",
secret: "",
jwks: {
jwksUri: "https://.auth0.com/.well-known/jwks.json",
},
});
```

```javascript
app.use(openid.router.routes()).use(openid.router.allowedMethods()); // use auth routes
app.use(openid.auth().unless({ path: [/^\/api\//] })); // use auth middleware
```