oauth2params

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Overview

Package oauth2params provides the generators of parameters such as state and PKCE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewState

func NewState() (string, error)

NewState returns a state parameter. This generates 256 bits of random bytes.

Types

type PKCE

type PKCE struct {
	CodeChallenge       string
	CodeChallengeMethod string
	CodeVerifier        string
}

PKCE represents a set of PKCE parameters. See https://tools.ietf.org/html/rfc7636.

func NewPKCE

func NewPKCE() (*PKCE, error)

NewPKCE returns a PKCE parameter. This generates 256 bits of random bytes.

func (*PKCE) AuthCodeOptions

func (pkce *PKCE) AuthCodeOptions() []oauth2.AuthCodeOption

AuthCodeOptions returns options for oauth2.Config.AuthCodeURL().

func (*PKCE) TokenRequestOptions

func (pkce *PKCE) TokenRequestOptions() []oauth2.AuthCodeOption

TokenRequestOptions returns options for oauth2.Config.Exchange().

Jump to

Keyboard shortcuts

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