oidc

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderGoogle = "google"
	ProviderGithub = "github"
)

Variables

This section is empty.

Functions

func AddProvider

func AddProvider(oidcProviderConfig OIDCProviderConfig) (err error)

func NotifyToken

func NotifyToken(state string, secret disco.NetworkSecret) error

func OIDCAuthURL added in v0.5.8

func OIDCAuthURL(w http.ResponseWriter, r *http.Request)

func OIDCSecret added in v0.5.8

func OIDCSecret(w http.ResponseWriter, r *http.Request)

func OIDCSelector added in v0.5.8

func OIDCSelector(w http.ResponseWriter, r *http.Request)

Types

type OIDCProvider

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

func Provider

func Provider(providerName string) (*OIDCProvider, bool)

func (*OIDCProvider) UserInfo

func (p *OIDCProvider) UserInfo(code string) (email string, extra map[string]any, err error)

type OIDCProviderConfig

type OIDCProviderConfig struct {
	Name         string   `yaml:"name"`
	Issuer       string   `yaml:"issuer"`
	ClientID     string   `yaml:"client_id"`
	ClientSecret string   `yaml:"client_secret"`
	RedirectURL  string   `yaml:"redirect_url"`
	Scopes       []string `yaml:"scopes"`
	AuthURL      string   `yaml:"auth_url"`
	TokenURL     string   `yaml:"token_url"`
	UserInfoURL  string   `yaml:"user_info_url"`
}

Jump to

Keyboard shortcuts

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