OAuth2 Koa Adapter
A custom koa-graphql-oauth2 adapter, this project is an spin off of the koa-oauth-server project.
Getting Started
This library is a koa-graphql-oauth2 adapter
Installation
Run npm install highoutput-oauth2
to install
Features
- The api is copied from the koa-oauth-server project
- This is an adapter specific for the apollo graphql-server
Quickstart
const path = ;const Koa = ;const Router = ;const bodyparser = ;const cors = ;const mongoose = ;const graphqlKoa graphiqlKoa = ;const makeExecutableSchema = ;const fileLoader mergeTypes mergeResolvers = ; const OAuth2Adapter = ;const OAuth2Model = ; const app = ;const router = ; moduleexports = start: async { await mongoose; /* eslint-disable */ ; ; ; ; /* eslint-enable */ const graphqlschema = schema: context: ctx ; const oauth2 = issuer: 'api.oauthtest.io' model: issuer: 'api.oauthtest.io' /* this is a custom model */ ; router; router; router; router; router; app; app; app; app; thisserver = app; } stop: async { await mongoose; await { thisserver; }; };
new OAuth2Adapter(options)
The stripe constructor accepts the following configuration
- options.issuer
{ String }
the jwt issuer value - options.model
{ Object }
the model object that contains the defined methods used to access oauth2 data
Model Specification
The model spec is exactly how it is defined on node-oauth2-server, you can instead go to the specified link and follow the model specification.