oauth

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: BSD-3-Clause Imports: 9 Imported by: 7

Documentation

Index

Constants

View Source
const ErrorAccessDenied = "access_denied"

Variables

This section is empty.

Functions

func IsAccessTokenError added in v1.22.0

func IsAccessTokenError(err error) bool

func IsRefreshTokenError added in v1.22.0

func IsRefreshTokenError(err error) bool

Types

type Provider

type Provider interface {
	provider.Provider

	Config() *oauth2.Config

	State(restrictedToken string) string // state = crypto of provider name, restrictedToken, secret
}

type Token

type Token struct {
	AccessToken    string    `json:"accessToken" bson:"accessToken"`
	TokenType      string    `json:"tokenType,omitempty" bson:"tokenType,omitempty"`
	RefreshToken   string    `json:"refreshToken,omitempty" bson:"refreshToken,omitempty"`
	ExpirationTime time.Time `json:"expirationTime,omitempty" bson:"expirationTime,omitempty"`
}

func NewToken

func NewToken() *Token

func NewTokenFromRawToken

func NewTokenFromRawToken(rawToken *oauth2.Token) (*Token, error)

func (*Token) Expire added in v1.22.0

func (t *Token) Expire()

func (*Token) MatchesRawToken

func (t *Token) MatchesRawToken(rawToken *oauth2.Token) bool

func (*Token) Normalize

func (t *Token) Normalize(normalizer structure.Normalizer)

func (*Token) Parse

func (t *Token) Parse(parser structure.ObjectParser)

func (*Token) RawToken

func (t *Token) RawToken() *oauth2.Token

func (*Token) Validate

func (t *Token) Validate(validator structure.Validator)

type TokenSource

type TokenSource interface {
	HTTPClient(ctx context.Context, prvdr Provider) (*http.Client, error)
	RefreshedToken() (*Token, error)
	ExpireToken()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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