token

package
v0.0.0-...-2eb5408 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDecoder = Decoder{}

Functions

This section is empty.

Types

type Decoder

type Decoder struct{}

func (Decoder) Decode

func (d Decoder) Decode(token *oauth2.Token) (Info, error)

type Info

type Info struct {
	UserID   string   `json:"user_id"`
	UserName string   `json:"user_name"`
	Scopes   []string `json:"scope"`
}

type InvalidFormatError

type InvalidFormatError string

func (InvalidFormatError) Error

func (e InvalidFormatError) Error() string

type Provider

type Provider struct {
	oauth2.Config
	Context context.Context
}

func (*Provider) LoginURL

func (p *Provider) LoginURL(state string) string

func (*Provider) RequestToken

func (p *Provider) RequestToken(code string) (*oauth2.Token, error)

Jump to

Keyboard shortcuts

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