code: func (a *Authenticator) GetMiddleware() router.Middleware {
  	return func(c *router.Context, next router.Handler) {
  		ctx, err := a.Authenticate(c.Context, c.Request)
  		switch {
  		case transient.Tag.In(err):
  			replyError(c.Context, c.Writer, 500, "Transient error during authentication", err)
  		case err != nil:
  			replyError(c.Context, c.Writer, 401, "Authentication error", err)
  		default:
  			c.Context = ctx
  			next(c)
  		}
  	}
  }
docs: // GetMiddleware returns a middleware that uses this Authenticator for
  // authentication.
  //
  // It uses a.Authenticate internally and handles errors appropriately.