oidc

package
v0.2.0-rc.11 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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