0.0.4 • Published 4 years ago
@hgc-ab/oauth-services v0.0.4
@hgc-ab/oauth-service
Compliant Oauth 2 Library for Node.js
Usage
Install
npm i @hgc-ab/oauth-service
This library used @hgc-ab/debug-service package for debug statements and if you want to debug - use .env files to set environment variables as below.
# Set any value to enforce debugging
DEBUG="@hgc-ab/oauth-service:*"
Note: .env files requires that you load them as early in your code as possible, see example below.
// Load env variables early
require('dotenv').config()
const Server = require('@hgc-ab/oauth-service')
const { Request, Response } = Server
// Your data model API
const model = {}
// Your new created Oauth 2 Server instance
const oAuth2Server = new Server(model)
Features
The @hgc-ab/oauth-service utilizes authorization server endpoints:
- Authorization endpoint, used by the client to obtain authorization grant from the resource owner.
- Token endpoint, used by the client to exchange an authorization grant for an access token, typically together with client authentication.
- Redirection endpoint - used by the authorization server to return responses containing authorization grant to the client via the resource owner user-agent.
For more information;
License
MIT