# mock-oauth-2-server

> ``` javascript const mockData = { client: { id : 'oauth2_application_client_id', secret : 'oauth2_application_secret', redirectUris : ['http://localhost:5000/oauth2/redirect/callback'], grants: ['authorization_code'] }, user: { id : '123', uuid : 'dkalfye

Latest version **1.0.3** (published 2017-06-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install mock-oauth-2-server
pnpm add mock-oauth-2-server
yarn add mock-oauth-2-server
bun add mock-oauth-2-server
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2017-06-05 |
| First published | 2017-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | policygenius |

## Links

- npm: https://www.npmjs.com/package/mock-oauth-2-server
- Repository: https://github.com/policygenius/mock-oauth-2-server
- npm.io page: https://npm.io/package/mock-oauth-2-server

## Dependencies (7)

- [uuid](https://npm.io/package/uuid.md) ^3.0.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [moment](https://npm.io/package/moment.md) ^2.18.1
- [express](https://npm.io/package/express.md) ^4.15.3
- [body-parser](https://npm.io/package/body-parser.md) ^1.17.2
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^7.4.1
- [express-oauth-server](https://npm.io/package/express-oauth-server.md) ^2.0.0-b1

## Recent versions

- 1.0.3 (latest) — 2017-06-05
- 1.0.2 — 2017-06-05

## README

Mock OAuth2 server for testing

### Mock Data ###
``` javascript
const mockData = {
  client: {
    id : 'oauth2_application_client_id',
    secret : 'oauth2_application_secret',
    redirectUris : ['http://localhost:5000/oauth2/redirect/callback'],
    grants: ['authorization_code']
  },
  user: {
    id : '123',
    uuid : 'dkalfyeoiqajaof',
    email: 'brad@email.com'
  },
  jwtSecret: 'jwt_secret_key'
};
```
### generateAccessToken ###
``` javascript
const defaultGenerateAccessToken(client, user, scope) {
  return jwt.sign(user, 'im_a_secret', { algorithm: 'HS512', jwtid: uuid() });
},
```

---
_Source: https://npm.io/package/mock-oauth-2-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
