Documentation
¶
Overview ¶
Package pkce implements the RFC 7636: "Proof Key for Code Exchange by OAuth Public Clients". This implementation support only the S256 method.
Index ¶
Constants ¶
View Source
const ( // MethodS256 specifies the S256 (SHA-256) verification method. MethodS256 = "S256" // ParamCodeChallenge defines the "code_challenge" form parameter // name. ParamCodeChallenge = "code_challenge" // ParamCodeChallengeMethod defines the "code_challenge_method" // form parameter. ParamCodeChallengeMethod = "code_challenge_method" // ParamCodeVerifier defines the "code_verifier" form parameter // name. ParamCodeVerifier = "code_verifier" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeVerifier ¶
type CodeVerifier string
CodeVerifier defines a code verifier instance.
func NewCodeVerifier ¶
func NewCodeVerifier() (CodeVerifier, error)
NewCodeVerifier creates a new random code verifier instance.
func (CodeVerifier) ChallengeS256 ¶
func (v CodeVerifier) ChallengeS256() (string, string)
ChallengeS256 creates a new S256 challenge. The function returns the challenge value and the challenge method specifier.
func (CodeVerifier) String ¶
func (v CodeVerifier) String() string
func (CodeVerifier) Verify ¶
func (v CodeVerifier) Verify(challenge, method string) bool
Verify verifies the challenge against the code verifier intance.
Click to show internal directories.
Click to hide internal directories.