pkce

package
v0.0.66 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const UnreservedCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"

UnreservedCharacters

unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~".

ref. https://www.rfc-editor.org/rfc/rfc3986#section-2.3

Variables

View Source
var ErrCodeVerifierLength = errors.New("pkce: code verifier length must be between 43 and 128")

Functions

This section is empty.

Types

type CodeChallengeMethod

type CodeChallengeMethod string
const (
	// CodeChallengeMethodPlainShouldNotBeUsed
	//
	// Clients are permitted to use "plain" only if they cannot support
	// "S256" for some technical reason and know via out-of-band
	// configuration that the server supports "plain".
	//
	// ref. https://www.rfc-editor.org/rfc/rfc7636#section-4.2
	CodeChallengeMethodPlainShouldNotBeUsed CodeChallengeMethod = "plain"
	// CodeChallengeMethodS256
	//
	// If the client is capable of using "S256", it MUST use "S256", as
	// "S256" is Mandatory To Implement (MTI) on the server.
	//
	//	code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier)))
	//
	// ref. https://www.rfc-editor.org/rfc/rfc7636#section-4.2
	CodeChallengeMethodS256 CodeChallengeMethod = "S256"
)

func (CodeChallengeMethod) String

func (c CodeChallengeMethod) String() string

type CodeVerifier

type CodeVerifier string

func CreateCodeVerifier

func CreateCodeVerifier(length int) (CodeVerifier, error)

func (CodeVerifier) Encode

func (c CodeVerifier) Encode(method CodeChallengeMethod) string

Jump to

Keyboard shortcuts

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