auth

package
v0.6.1-0...-03080b3 Latest Latest
Warning

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

Go to latest
Published: May 20, 2014 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBasicAuthenticator

func NewBasicAuthenticator(secrets SecretProvider, Realm string) beego.FilterFunc

Types

type BasicAuth

type BasicAuth struct {
	Secrets SecretProvider
	Realm   string
}

func (*BasicAuth) CheckAuth

func (a *BasicAuth) CheckAuth(r *http.Request) string

Checks the username/password combination from the request. Returns either an empty string (authentication failed) or the name of the authenticated user.

Supports MD5 and SHA1 password entries

func (*BasicAuth) RequireAuth

func (a *BasicAuth) RequireAuth(w http.ResponseWriter, r *http.Request)

http.Handler for BasicAuth which initiates the authentication process (or requires reauthentication).

type SecretProvider

type SecretProvider func(user, pass string) bool

Jump to

Keyboard shortcuts

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