func New(userStores ...authdb.UserStore) authdb.UserStore
New initializes a group of auth handlers. Each one is tried in turn, in the order passed to New.
AuthGroup is a group of auth handlers, to be tried in turn.
type AuthGroup []authdb.UserStore
func (g AuthGroup) UserCtx(ctx context.Context, username string) (*authdb.UserContext, error)
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 (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.