oidc

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	Configured() bool
	ExchangeCodeForToken(ctx context.Context, code, redirectURI string) (*User, error)
	GetAuthURL(ctx context.Context, state, redirectURI string) (string, error)
}

func New

func New(issuerURL, clientID, clientSecret, redirectURI string) (Service, error)

New defers provider discovery until authentication is requested.

func NewServiceWithLogging

func NewServiceWithLogging(base Service, logger *slog.Logger) Service

NewServiceWithLogging wraps base with method completion logging.

type ServiceWithLogging

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

ServiceWithLogging implements Service with method completion logging.

func (ServiceWithLogging) Configured

func (_d ServiceWithLogging) Configured() (b1 bool)

Configured implements Service.

func (ServiceWithLogging) ExchangeCodeForToken

func (_d ServiceWithLogging) ExchangeCodeForToken(ctx context.Context, code string, redirectURI string) (up1 *User, err error)

ExchangeCodeForToken implements Service.

func (ServiceWithLogging) GetAuthURL

func (_d ServiceWithLogging) GetAuthURL(ctx context.Context, state string, redirectURI string) (s1 string, err error)

GetAuthURL implements Service.

type User

type User struct {
	ProviderID        string // Provider-specific user ID (sub claim)
	Email             string
	EmailVerified     bool
	Name              string
	Picture           string
	GivenName         string
	FamilyName        string
	Locale            string // BCP 47 language tag
	PreferredUsername string // OIDC preferred_username claim
}

Jump to

Keyboard shortcuts

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