Help us shape the future of Go! Take the 2026 Go Developer Survey

oidc

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCodeRefused    = errors.New("oidc: the provider refused the code")
	ErrTokensRejected = errors.New("oidc: the tokens failed a check")
	ErrProvider       = errors.New("oidc: the provider failed")
)

Functions

func Module

func Module(paths Paths) app.Module

Types

type Client

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

func (*Client) SignIn

func (c *Client) SignIn(ctx context.Context, req SignInRequest) (SignInResult, error)

type Config

type Config struct {
	Enabled      bool   `config:"enabled"`
	Issuer       string `config:"issuer"        validate:"required_with=Enabled,omitempty,url"`
	ClientID     string `config:"client_id"     validate:"required_with=Enabled"`
	ClientSecret string `config:"client_secret" validate:"required_with=Enabled"`
	PublicURL    string `config:"public_url"    validate:"required_with=Enabled,omitempty,url"`

	RequestTimeout time.Duration `config:"request_timeout" validate:"gt=0"`

	DangerouslyAllowInsecureHTTP bool `config:"dangerously_allow_insecure_http"`
}

type Identity

type Identity struct {
	Issuer            string
	Subject           string
	Email             string
	Name              string
	PreferredUsername string
}

type Paths

type Paths struct {
	Redirect string
}

Paths are the paths under public_url that the client uses.

type SignInRequest

type SignInRequest struct {
	Code         string
	CodeVerifier string
	Nonce        string
}

type SignInResult

type SignInResult struct {
	Identity Identity
	IDToken  string
}

Jump to

Keyboard shortcuts

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