Documentation ¶
Overview ¶
General use authentication package for Go.
To get started, visit the Gomniauth GitHub project homepage: https://github.com/stretchr/gomniauth
Index ¶
- Variables
- func GetSecurityKey() string
- func NewState(keyAndValuePairs ...interface{}) *common.State
- func Provider(name string) (common.Provider, error)
- func ProviderPublicData(provider common.Provider, options map[string]interface{}) (interface{}, error)
- func SetSecurityKey(key string)
- func StateFromParam(paramValue string) (*common.State, error)
- type ProviderList
Constants ¶
This section is empty.
Variables ¶
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.
Functions ¶
func NewState ¶
NewState creates a new object that can be used to persist state across authentication requests.
func Provider ¶
Provider gets a provider by name from the SharedProviderList, or returns a common.MissingProviderError if no provider with that name is registered.
func ProviderPublicData ¶
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 ¶
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.
Types ¶
type ProviderList ¶
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 ¶
func WithProviders(providers ...common.Provider) *ProviderList
WithProviders generates a new ProviderList which should be used to interact with Gomniauth services.
func (*ProviderList) Add ¶
func (l *ProviderList) Add(provider common.Provider) *ProviderList
Add adds a provider to this list.
func (*ProviderList) Provider ¶
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 ¶
func (l *ProviderList) Providers() []common.Provider
Providers gets all registered Provider objects.