Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteWWWAuthenticateHeader ¶
func WriteWWWAuthenticateHeader( w http.ResponseWriter, scheme string, realm string, params map[string]string, err error, )
WriteWWWAuthenticateHeader writes the `WWW-Authenticate` http response header for the supplied scheme.
Types ¶
type Authentication ¶
type Authentication struct {
// contains filtered or unexported fields
}
Authentication applies login flows to auth requests.
func (*Authentication) Required ¶ added in v0.30.42
func (a *Authentication) Required() *Authentication
func (*Authentication) ServeHTTP ¶
func (a *Authentication) ServeHTTP( _ httpsrv.Middleware, w http.ResponseWriter, r *http.Request, m httpsrv.Middleware, h miruken.Handler, n func(miruken.Handler), )
func (*Authentication) WithFlow ¶ added in v0.30.39
func (a *Authentication) WithFlow(flow login.Flow) *FlowBuilder
func (*Authentication) WithFlowRef ¶ added in v0.30.39
func (a *Authentication) WithFlowRef(ref string) *FlowBuilder
type Basic ¶ added in v0.30.34
type Basic struct {
Realm string
}
Basic is a http authentication Scheme that uses a username and password to protect resources.
type Bearer ¶
type Bearer struct {
Realm string
}
Bearer is a http authentication Scheme that uses an opaque string (token) to protect resources.
type FlowBuilder ¶
type FlowBuilder struct {
// contains filtered or unexported fields
}
FlowBuilder configures a login flow.
func WithFlow ¶
func WithFlow(flow login.Flow) *FlowBuilder
WithFlow starts a new authentication flow builder with the definition of a login flow.
func WithFlowRef ¶
func WithFlowRef(flow string) *FlowBuilder
WithFlowRef starts a new authentication flow builder with a reference to a login flow.
func (*FlowBuilder) Basic ¶ added in v0.30.34
func (b *FlowBuilder) Basic() *Authentication
Basic configures an authentication flow to use `Basic` auth.
func (*FlowBuilder) BasicInRealm ¶ added in v0.30.34
func (b *FlowBuilder) BasicInRealm(realm string) *Authentication
BasicInRealm configures an authentication flow to use `Basic` auth in the supplied realm.
func (*FlowBuilder) Bearer ¶
func (b *FlowBuilder) Bearer() *Authentication
Bearer configures an authentication flow to use `Bearer` tokens.
func (*FlowBuilder) BearerInRealm ¶
func (b *FlowBuilder) BearerInRealm(realm string) *Authentication
BearerInRealm configures an authentication flow to use `Bearer` tokens in the supplied realm.
func (*FlowBuilder) Scheme ¶
func (b *FlowBuilder) Scheme(scheme Scheme) *Authentication