code: func (s *Server) authenticate(conn io.Writer, bufConn io.Reader) (*AuthContext, error) {
  	// Get the methods
  	methods, err := readMethods(bufConn)
  	if err != nil {
  		return nil, fmt.Errorf("Failed to get auth methods: %v", err)
  	}
  
  	// Select a usable method
  	for _, method := range methods {
  		cator, found := s.authMethods[method]
  		if found {
  			return cator.Authenticate(bufConn, conn)
  		}
  	}
  
  	// No usable method found
  	return nil, noAcceptableAuth(conn)
  }
docs: // authenticate is used to handle connection authentication