Documentation ¶
Overview ¶
Package PKCE implements Proof Key for Code Exchange by OAuth Public Clients.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Challenge ¶
type Challenge [43]byte
Challenge is a 43-octet URL safe PKCE Code Challenge.
Use Challenge.String to get a string representation of the challenge or Challenge.AuthCodeOption to get an option compatible with oauth2.Config.Exchange.
func ChallengeFromString ¶
ChallengeFromString returns a challenge from its string representation.
func (Challenge) AuthCodeOption ¶
func (c Challenge) AuthCodeOption() oauth2.AuthCodeOption
AuthCodeOption returns an option compatible with oauth2.Config.Exchange.
func (Challenge) String ¶
String returns the string representation of the PKCE Code Challenge.
It implements fmt.Stringer.
type Method ¶
type Method uint8
Method used to create the PKCE Code Challenge.
Available methods for creating the PKCE Code Challenge.
If the client is capable of using MethodS256, it MUST use MethodS256, as MethodS256 is Mandatory To Implement (MTI) on the server. Clients are permitted to use MethodPlain only if they cannot support MethodS256 for some technical reason and know via out-of-band configuration that the server supports MethodPlain.
The MethodPlain transformation is for compatibility with existing deployments and for constrained environments that can't use the MethodS256 transformation.
See also: https://datatracker.ietf.org/doc/html/rfc7636#section-4.2.
func MethodFromString ¶
MethodFromString returns a method from its string representation.
func (Method) AuthCodeOption ¶
func (m Method) AuthCodeOption() oauth2.AuthCodeOption
AuthCodeOption returns an option compatible with oauth2.Config.Exchange.
type Verifier ¶
type Verifier [43]byte
Verifier is a 43-octet URL safe PKCE Code Verifier.
Use Verifier.String to get a string representation of the verifier or Verifier.AuthCodeOption to get an option compatible with oauth2.Config.AuthCodeURL.
func VerifierFromString ¶
VerifierFromString returns a verifier from its string representation.
func (Verifier) AuthCodeOption ¶
func (v Verifier) AuthCodeOption() oauth2.AuthCodeOption
AuthCodeOption returns an option compatible with oauth2.Config.AuthCodeURL.
func (Verifier) Challenge ¶
Challenge creates the PKCE Code Challenge for the PKCE Code Verifier using the given method.
If the client is capable of using MethodS256, it MUST use MethodS256, as MethodS256 is Mandatory To Implement (MTI) on the server. Clients are permitted to use MethodPlain only if they cannot support MethodS256 for some technical reason and know via out-of-band configuration that the server supports MethodPlain.
The MethodPlain transformation is for compatibility with existing deployments and for constrained environments that can't use the MethodS256 transformation.
See also: https://datatracker.ietf.org/doc/html/rfc7636#section-4.2.
func (Verifier) String ¶
String returns the string representation of the PKCE Code Verifier.
It implements fmt.Stringer.