oauth

package
v0.0.0-...-99409e2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2018 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SpotifyConfig

func SpotifyConfig(appBaseURL string, config *Config, scopes []spotify.Scope) *oauth2.Config

Types

type Config

type Config struct {
	ClientID     string `yaml:"client_id"`
	ClientSecret string `yaml:"client_secret"`
}

type OAuth

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

func NewOAuth

func NewOAuth(config *oauth2.Config, sessions *requests.Sessions, userStore model.UserStore,
	errorHandler func(http.ResponseWriter, error)) *OAuth

func (*OAuth) AccessToken

func (o *OAuth) AccessToken(user *model.User) (string, error)

func (*OAuth) BindToMux

func (o *OAuth) BindToMux(mux *mux.Router)

func (*OAuth) CallbackHandler

func (o *OAuth) CallbackHandler(rw http.ResponseWriter, req *http.Request)

func (*OAuth) MustBeAuthed

func (o *OAuth) MustBeAuthed(handler http.HandlerFunc, errorHandler func(http.ResponseWriter, error)) http.HandlerFunc

func (*OAuth) OptionallyAuthed

func (o *OAuth) OptionallyAuthed(handler http.HandlerFunc, errorHandler func(http.ResponseWriter, error)) http.HandlerFunc

Jump to

Keyboard shortcuts

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