Documentation ¶
Overview ¶
Package auth provides various authentication related utilities
Index ¶
- Constants
- func AddConstProvider(funcs template.FuncMap) template.FuncMap
- func Authenticate(returnTo string, errorHandler func(http.ResponseWriter, *http.Request, error)) func(http.Handler) http.Handler
- func CompareHashAndPassword(passwordhash string, password string) error
- func Deserialize(key string, input string, outputAddr interface{}) (err error)
- func GenerateRandomString() (string, error)
- func Hash(key string, input []byte) (output string)
- func HashPassword(password string) (string, error)
- func IsValidProvider(provider string) bool
- func Redirect(w http.ResponseWriter, r *http.Request, provider, returnTo string, ...)
- func Serialize(key string, input interface{}) (output string, err error)
Constants ¶
View Source
const ( ErrDeserializeOutputInvalid erro.BaseError = "deserialize output is invalid because provided signature [%s] does not match computed signature [%s]" ErrDeserializeInputInvalid erro.BaseError = "deserialize input [%s] is invalid because missing '.' in string" )
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
func CompareHashAndPassword ¶
func Deserialize ¶
Deserialize will deserialize any input string back into an object that was serialized with Serialize. It requires the same key that was used to serialize the variable in order to verify the digital signature of the payload. If the digital signature doesn't match, it will return ErrDeserializeOutputInvalid
func GenerateRandomString ¶
func Hash ¶
Hash will hash input byte slice and output a string. Takes in a key to salt the hashing algorithm
THIS IS NOT SAFE FOR PASSWORD HASHING. Use HashPassword and its companion function CompareHashAndPassword instead
func HashPassword ¶
func IsValidProvider ¶
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package oauth is a wrapper around x/oauth2 to provide oauth2 authetication for various providers
|
Package oauth is a wrapper around x/oauth2 to provide oauth2 authetication for various providers |
Package openid partially implements the OpenID 2.0 specification for the Relying Party (RP) in Stateless Mode
|
Package openid partially implements the OpenID 2.0 specification for the Relying Party (RP) in Stateless Mode |
Click to show internal directories.
Click to hide internal directories.