oauthflow

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 20 Imported by: 0 modules, 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

View Source
const DefaultCallbackPort = 3142

Variables

This section is empty.

Functions

func BuildAuthorizationHandler

func BuildAuthorizationHandler(st *state.State, opts AuthorizeOptions, client *http.Client) (*auth.AuthorizationCodeHandler, func(), error)

func Refresh

func Refresh(ctx context.Context, st *state.State, client *http.Client) (*state.TokenState, error)

func RefreshWithToken

func RefreshWithToken(ctx context.Context, st *state.State, refreshToken string, client *http.Client) (*state.TokenState, error)

func Register

func Register(ctx context.Context, st *state.State, opts RegisterOptions, client *http.Client) error

func TokenFromSource

func TokenFromSource(ctx context.Context, handler auth.OAuthHandler) (*state.TokenState, error)

func VerifyPKCES256

func VerifyPKCES256(asm *oauthex.AuthServerMeta) bool

Types

type AuthorizeOptions

type AuthorizeOptions struct {
	CallbackPort int
	OpenBrowser  bool
	Out          io.Writer
	Logger       *slog.Logger
}

type DiscoverResult

type DiscoverResult struct {
	MetadataURL string
	Protected   *oauthex.ProtectedResourceMetadata
	AuthServer  *oauthex.AuthServerMeta
}

func Discover

func Discover(ctx context.Context, serverURL string, client *http.Client) (*DiscoverResult, error)

type RegisterOptions

type RegisterOptions struct {
	RedirectURL             string
	ClientName              string
	Scopes                  []string
	ClientID                string
	ClientSecret            string
	TokenEndpointAuthMethod string
}

Jump to

Keyboard shortcuts

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