issuer

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issuer

type Issuer struct {
	// contains filtered or unexported fields
}

Issuer implements token issuing

func New

func New(oauthConfig *oauth2.Config, opts ...Option) *Issuer

New creates new token issuer

func (*Issuer) AuthCodeURL

func (i *Issuer) AuthCodeURL(w http.ResponseWriter) string

AuthCodeURL returns a URL to OAuth 2.0 provider's consent page

func (*Issuer) Client

func (i *Issuer) Client(t *oauth2.Token) *http.Client

Client returns an HTTP client using the provided token.

func (*Issuer) Exchange

func (i *Issuer) Exchange(r *http.Request) (*oauth2.Token, error)

Exchange will exchange auth code for auth token

type Option

type Option func(opts *Issuer)

Option configures the issuer

func WithTLSConfig

func WithTLSConfig(tlsConfig *tls.Config) Option

WithTLSConfig option is for definition of secured HTTP transport using a tls.Config instance

Jump to

Keyboard shortcuts

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