oidc

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const Path string = "/oauth2"

Variables

This section is empty.

Functions

func NewLoginHandler

func NewLoginHandler(config Config) http.Handler

func NewRouter

func NewRouter(config Config) *chi.Mux

Types

type Config

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

type ConfigSchema

type ConfigSchema struct {
	Providers     []ProviderSchema `json:"providers"`
	SkipLoginPage bool             `json:"skipLoginPage"`
}

func (*ConfigSchema) CreateConfig

func (s *ConfigSchema) CreateConfig() Config

func (*ConfigSchema) Validate

func (s *ConfigSchema) Validate() error

type Provider

type Provider struct {
	ID           string
	StartPath    string
	OIDCProvider *oidc.Provider
	Verifier     *oidc.IDTokenVerifier
	OAuth2Config *oauth2.Config
}

type ProviderSchema

type ProviderSchema struct {
	ID           string `json:"id"`
	ClientID     string `json:"clientID"`
	ClientSecret string `json:"clientSecret"`
	RedirectURL  string `json:"redirectURL"`
	StartPath    string `json:"startPath"`

	// スコープの内、"oidc"を除いたもの。oidcは自動追加するため不要
	Scopes []string `json:"scopes"`

	// IssuerからOIDC Discoveryを使うため、その他の情報は不要
	Issuer string `json:"issuer"`
}

Jump to

Keyboard shortcuts

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