oauthflow

package
v0.5.0-rc.5-linux-arm64 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: Apache-2.0 Imports: 7 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

View Source
const DefaultCallbackWindow = 10 * time.Minute
View Source
const PKCES256 = "S256"

Variables

View Source
var (
	ErrOAuthStateInvalid  = xerror.New(xerror.KindInvalidInput, "OAUTH_STATE_INVALID", "oauth state invalid")
	ErrOAuthStateConsumed = xerror.New(xerror.KindInvalidInput, "OAUTH_STATE_CONSUMED", "oauth state consumed")
	ErrOAuthStateExpired  = xerror.New(xerror.KindInvalidInput, "OAUTH_STATE_EXPIRED", "oauth state expired")
)

Functions

func CallbackWindow

func CallbackWindow(moreTime bool) time.Duration

CallbackWindow returns the Core deadline window selected before provider authorization.

func HashState

func HashState(state string) string

HashState returns a stable non-secret digest for a raw OAuth state value.

func RandomState

func RandomState() (string, error)

RandomState returns a cryptographically random browser-safe OAuth state.

func S256Challenge

func S256Challenge(verifier string) string

func SafeProviderError

func SafeProviderError(code string, fields map[string]string) error

SafeProviderError maps provider response fields to a credential-safe error.

func ValidPKCEVerifier

func ValidPKCEVerifier(verifier string) bool

Types

type ProviderError

type ProviderError struct {
	Code    string
	Message string
}

func (ProviderError) Error

func (e ProviderError) Error() string

Jump to

Keyboard shortcuts

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