Documentation ¶
Overview ¶
Package authgroup groups two or more authentication backends together, trying one, then falling through to the others.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthGroup ¶
AuthGroup is a group of auth handlers, to be tried in turn.
func (AuthGroup) UserCtx ¶
UserCtx loops through each of the auth handlers, in the order passed to New until the context is cancelled, in which case the context's error is returned. The first one to not return an error returns. If all of the handlers return a Not Found error, Not Found is returned. If any other errors are returned, the first is returned to the caller.
func (AuthGroup) Validate ¶
func (g AuthGroup) Validate(ctx context.Context, username, password string) (*authdb.UserContext, error)
Validate loops through each of the auth handlers, in the order passed to New, until the context is cancelled, in which case the context's error is returned. The first validation success returns. Errors are discarded unless all auth handlers fail to validate the user, in which case only the first error received will be returned.