gomniauth: github.com/stretchr/gomniauth Index | Files | Directories

package gomniauth

import "github.com/stretchr/gomniauth"

General use authentication package for Go.

To get started, visit the Gomniauth GitHub project homepage: https://github.com/stretchr/gomniauth

Index

Package Files

doc.go facade.go provider_list.go security.go shortcuts.go

Variables

var SharedProviderList common.ProviderList

SharedProviderList keeps track of the last created ProviderList. It is useful for using shortcut methods directly on gomniauth package rather than having to refer to the list.

func GetSecurityKey Uses

func GetSecurityKey() string

GetSecurityKey gets the security key.

func NewState Uses

func NewState(keyAndValuePairs ...interface{}) *common.State

NewState creates a new object that can be used to persist state across authentication requests.

func Provider Uses

func Provider(name string) (common.Provider, error)

Provider gets a provider by name from the SharedProviderList, or returns a common.MissingProviderError if no provider with that name is registered.

func ProviderPublicData Uses

func ProviderPublicData(provider common.Provider, options map[string]interface{}) (interface{}, error)

ProviderPublicData gets the public data for the specified provider.

The options should contain the `loginpathFormat`, which will determine how the loginpath value is created.

func SetSecurityKey Uses

func SetSecurityKey(key string)

SetSecurityKey sets the global security key to be used for signing the state variable in the auth request. This allows gomniauth to detect if the data in the state variable has been changed.

func StateFromParam Uses

func StateFromParam(paramValue string) (*common.State, error)

StateFromParam decodes the state parameter hash and turns it into a usable State object.

type ProviderList Uses

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

ProviderList represents a simple common.ProviderList that holds an array of providers, and allows access to them.

func WithProviders Uses

func WithProviders(providers ...common.Provider) *ProviderList

WithProviders generates a new ProviderList which should be used to interact with Gomniauth services.

func (*ProviderList) Add Uses

func (l *ProviderList) Add(provider common.Provider) *ProviderList

Add adds a provider to this list.

func (*ProviderList) Provider Uses

func (l *ProviderList) Provider(name string) (common.Provider, error)

Provider gets a provider by name, or returns a common.MissingProviderError if no provider with that name is registered.

func (*ProviderList) Providers Uses

func (l *ProviderList) Providers() []common.Provider

Providers gets all registered Provider objects.

Directories

PathSynopsis
common
example
example/goweb
example/nethttp
oauth2
providers/facebook
providers/github
providers/gitlab
providers/google
providers/heroku
providers/instagram
providers/soundcloud
providers/spotify
providers/uber
test

Package gomniauth imports 3 packages (graph) and is imported by 123 packages. Updated 2017-09-13. Refresh now. Tools for package owners.