Github
Follow the instructions at https://github.com/settings/apps/new (or https://github.com/organizations/<your_org>/settings/apps/new for orgs).
GitHub App name: "My Gatekeeper"
Description: "Caddy v2 Authentication Portal"
Homepage URL: https://localhost:8443/
User authorization callback URL: https://localhost:8443/oauth2/github/authorization-code-callback
Check "Expire user authorization tokens".
Check "Request user authorization (OAuth) during installation"
Upon successful completion of the instructions, you will get:

Additionally, click "generate a private key" to sign access token requests.

This Caddyfile
allows Github-based authentication.
The users authenticating via Github would have to accept the terms:

Email Claims​
To allow the extraction of email addresses from Github, you would need to configure permissions to allow it.
The path is Account permissions -> Email addresses, Access: Read Only.


Then, then users will be prompted to accept.

The email claims will be visible in the /whoami.
