# GitHub

Sign in with GitHub.

| Field | Value |
|---|---|
| Addon id | `sso-github` |
| Kind | `sso` |
| Provides | `github` |
| Engine | `wasm` |
| ABI | `0.2.0` |
| Version | 0.1.0 |
| Author | MythicalSystems |
| Source | `extensions/addons/sso-github` |
| Permissions (shown at install) | `network.outbound` |

## Capabilities

| Capability | Value |
|---|---|
| [`http`](capabilities.md) | `github.com`, `api.github.com`, `$setting:token_url`, `$setting:userinfo_url` |
| [`secrets`](capabilities.md) | none |

## Events and hooks

| What | Value |
|---|---|
| Listens to (`events`) | none |
| Hooks | none |
| Emits | none |
| Mixins | none |
| Scheduled jobs | none |

## Settings and secrets

| Setting | Type | Required |
|---|---|---|
| `client_id` | `text` | no |
| `client_secret` | `secret` | no |
| `button_label` | `text` | no |
| `allow_register` | `bool` | no |
| `link_by_verified_email` | `bool` | no |
| `allow_staff` | `bool` | no |
| `authorize_url` | `text` | no |
| `token_url` | `text` | no |
| `userinfo_url` | `text` | no |
| `scope` | `text` | no |

Secrets (stored encrypted, never returned by the API): none.

Outbound HTTP allowed to: `github.com`, `api.github.com`, `$setting:token_url`, `$setting:userinfo_url`. `$server` is the hostname of the server configured for the product, `$setting:<key>` the host of that setting.

## addon.json

_extensions/addons/sso-github/addon.json_

```json
{
  "abi": "0.2.0",
  "author": "MythicalSystems",
  "capabilities": {
    "http": [
      "github.com",
      "api.github.com",
      "$setting:token_url",
      "$setting:userinfo_url"
    ],
    "secrets": []
  },
  "description": "addons.desc.sso.github",
  "engine": "wasm",
  "id": "sso-github",
  "kind": "sso",
  "name": "GitHub",
  "permissions": [
    "network.outbound"
  ],
  "provides": "github",
  "settings": [
    {
      "default": "",
      "key": "client_id",
      "kind": "text",
      "label": "addons.sso.setting.client_id",
      "required": false
    },
    {
      "default": "",
      "key": "client_secret",
      "kind": "secret",
      "label": "addons.sso.setting.client_secret",
      "required": false
    },
    {
      "default": "",
      "key": "button_label",
      "kind": "text",
      "label": "addons.sso.setting.button_label",
      "required": false
    },
    {
      "default": true,
      "key": "allow_register",
      "kind": "bool",
      "label": "addons.sso.setting.allow_register",
      "required": false
    },
    {
      "default": false,
      "key": "link_by_verified_email",
      "kind": "bool",
      "label": "addons.sso.setting.link_by_verified_email",
      "required": false
    },
    {
      "default": false,
      "key": "allow_staff",
      "kind": "bool",
      "label": "addons.sso.setting.allow_staff",
      "required": false
    },
    {
      "default": "",
      "key": "authorize_url",
      "kind": "text",
      "label": "addons.sso.setting.authorize_url",
      "required": false
    },
    {
      "default": "",
      "key": "token_url",
      "kind": "text",
      "label": "addons.sso.setting.token_url",
      "required": false
    },
    {
      "default": "",
      "key": "userinfo_url",
      "kind": "text",
      "label": "addons.sso.setting.userinfo_url",
      "required": false
    },
    {
      "default": "",
      "key": "scope",
      "kind": "text",
      "label": "addons.sso.setting.scope",
      "required": false
    }
  ],
  "version": "0.1.0",
  "wasm": "addon.wasm"
}
```

