code: func (a Authenticator) Authenticate(ctx context.Context) (newCtx context.Context, err error) {
  	defer func() {
  		if err == nil {
  			// Store user metadata
  			userMD := &UserMetadata{
  				ID: a.Username,
  			}
  			newCtx = context.WithValue(newCtx, userMDKey{}, userMD)
  		}
  	}()
  
  	err = a.tryTLSAuth(ctx)
  	if err == nil {
  		return ctx, nil
  	}
  
  	newCtx, err = a.tryTokenAuth(ctx)
  	if err == nil {
  		return newCtx, nil
  	}
  
  	return a.tryBasicAuth(ctx)
  }
docs: // Authenticate checks that a token exists and is valid. It stores the user
  // metadata in the returned context and removes the token from the context.