github

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package github provides a non-OIDC OAuth 2.0 adapter for GitHub login that produces oidc.Identity and shares oidc.Store for pending state and bindings.

Status: CANDIDATE. Capability: identity.oidc-social (GitHub adapter).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ClientID     string
	ClientSecret string
	RedirectURI  string // absolute https or loopback http
	AuthURL      string // optional override
	TokenURL     string
	UserURL      string
	EmailURL     string
	Scopes       []string // default: read:user user:email
	StateTTL     time.Duration
	HTTPClient   *http.Client
}

Config for GitHub OAuth.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service runs GitHub OAuth and uses oidc.Store for pending + bindings.

func New

func New(cfg Config, store oidc.Store) (*Service, error)

New validates config.

func (*Service) Accept

func (s *Service) Accept(ctx context.Context, state, code string) (oidc.Identity, error)

Accept exchanges the code and returns oidc.Identity.

func (*Service) LinkBinding

func (s *Service) LinkBinding(ctx context.Context, subject, accountID string) error

LinkBinding delegates to oidc.Service semantics via store.

func (*Service) Start

func (s *Service) Start(ctx context.Context) (StartResult, error)

Start begins GitHub OAuth.

type StartResult

type StartResult struct {
	AuthURL string
	State   string
}

StartResult for the browser.

Jump to

Keyboard shortcuts

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