oidc

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: GPL-3.0 Imports: 11 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 HandleNotifyToken

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

func NotifyToken

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

func RedirectAuthURL

func RedirectAuthURL(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