github

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package github is Sign in with GitHub for identity: OAuth 2.0 with PKCE, the user read from the REST API.

auth := identity.MustNew(cfg.Auth, d,
	identity.Providers(github.New(cfg.Auth.Providers["github"])))

It reads, from auth.providers.github: client_id and client_secret (an OAuth app of the GitHub settings), redirect_url (the app's callback: https://api.example.com/auth/github/callback), scopes (read:user and user:email by default) and endpoint (a GitHub Enterprise server, https://github.example.com; github.com unless set). It refuses hosted_domain, team_id and key_id.

The account id is GitHub's numeric user id, stable across renames. The email is the one /user shows, or else the primary verified address of /user/emails; without either, the identity has no email and cannot create an account (it can still be linked to one).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New returns the GitHub provider for pc. A configuration it refuses makes identity.New fail with the reason.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL