Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/abouslimi/koa-openid-client
- Owner: abouslimi
- License: mit
- Created: 2022-11-13T23:59:51.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-14T09:29:18.000Z (about 2 years ago)
- Last Synced: 2024-11-16T16:20:57.194Z (about 2 months ago)
- Topics: auth, auth0, authentication, authorization, koa, koa2, koajs, middleware, openid, openid-client, openid-connect
- Language: TypeScript
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```