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

oauthgotypes

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolString

type BoolString bool

func (*BoolString) UnmarshalJSON

func (b *BoolString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type Locale

type Locale struct {
	Value string
}

Locale is a custom type for handling OIDC locale claims.

func (*Locale) UnmarshalJSON

func (l *Locale) UnmarshalJSON(b []byte) error

type Mode

type Mode int

Mode represents the authentication mode.

const (
	OAuth2Only Mode = iota
	OIDC
)

type OAuth2OIDCOptions

type OAuth2OIDCOptions struct {
	Name        *string        // optional
	Mode        *Mode          // optional
	OAuth2      *OAuth2Options // optional
	OIDC        *OIDCOptions   // optional
	UserInfoURL *string        // optional, add ONLY if OIDC is not supported by the provider
}

OAuth2OIDCOptions are the options for the provider.

type OAuth2Options

type OAuth2Options struct {
	AuthURL          *string   // required
	TokenURL         *string   // required
	RevocationURL    *string   // optional, provide if the provider supports RFC7009 token revocation
	Scopes           *[]string // required
	PKCEAuthURL      *string   // optional, defaults to AuthURL
	PKCEPublicClient *bool     // optional, defaults to false (if true, client secret is not sent in token exchange)
	UsePKCE          *bool     // optional, defaults to true. Set false to disable PKCE (not recommended)
	ExtraAuth        *map[string]string
}

OAuth2Options are the options for OAuth2.

type OIDCOptions

type OIDCOptions struct {
	Issuer                     *string   // required
	JWKSURL                    *string   // optional
	UserInfoURL                *string   // required
	Scopes                     *[]string // required
	DisableDiscovery           *bool     // optional, defaults to false. Set to true to skip OIDC discovery (not recommended)
	DisableIdTokenVerification *bool     // optional, defaults to false. Set to true to skip id_token verification (not recommended)
}

OIDCOptions are the options for OIDC.

type ProviderConfig

type ProviderConfig struct {
	ClientID          string
	ClientSecret      string
	OAuth2ODICOptions *OAuth2OIDCOptions
	UserInfoURL       *string
	ExtraConfig       *map[string]string
}

ProviderConfig is the config for the provider.

Jump to

Keyboard shortcuts

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