# sinopia-github-oauth-env

> authentication plugin for sinopia2, supporting github oauth web flow and environment variables

Latest version **1.0.1** (published 2017-12-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install sinopia-github-oauth-env
pnpm add sinopia-github-oauth-env
yarn add sinopia-github-oauth-env
bun add sinopia-github-oauth-env
```

## 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.1 |
| Published | 2017-12-21 |
| First published | 2017-12-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | pragone |
| Keywords | sinopia, npm, github, oauth, auth, plugin |

## Links

- npm: https://www.npmjs.com/package/sinopia-github-oauth-env
- Repository: https://github.com/hipages/sinopia-github-oauth
- Homepage: https://github.com/hipages/sinopia-github-oauth#readme
- Issues: https://github.com/hipages/sinopia-github-oauth/issues
- npm.io page: https://npm.io/package/sinopia-github-oauth-env

## Dependencies (1)

- [http-errors](https://npm.io/package/http-errors.md) ^1.4.0

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-12-21

## README

# sinopia-github-oauth
Sinopia authentication plugin with github oauth web flow

This will allow you to auth via github web oauth flow. It is compatible with [sinopia2](https://www.npmjs.com/package/sinopia2) (v2.0.2 and later)

## Installation
* Create an [oauth application](https://github.com/settings/applications/new) in github
* Set the callback url of your github application to http://url-to.your.registry/oauth/callback
* `$ npm i sinopia2 -g`
* `$ npm i sinopia-github-oauth -g`

## Configuration
Add the following in your `config.yaml`
```yaml
middlewares:
  github-oauth:
    client-id: github-app-id # required
    client-secret: github-app-secret # required

auth:
  github-oauth:
    org: soundtrackyourbrand # required, people within this org will be able to auth
    cache-ttl-ms: 60000 # default to 30s if not present
```

Alternatively, this fork allows you to use environment variables to configure the client-id and client-secret. Respectively: `OAUTH_CLIENT_ID` and `OAUTH_CLIENT_SECRET`.

## Run
`$ sinopia -c /path/to/config.yaml -l 0.0.0.0:4873`

## Authenticating
You cannot use `npm login` to authenticate via this method, instead install [sinopia-github-oauth-cli](https://github.com/soundtrackyourbrand/sinopia-github-oauth-cli)

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