def authentication_path(local_port: nil, invite_code: nil, expires_in: nil, remote: false)
      auth_url_params = {}
      if remote
        auth_url_params[:redirect_uri] = "/code"
      elsif local_port
        auth_url_params[:redirect_uri] = "http://localhost:#{local_port}/cb"
      else
        raise ArgumentError, "Local port not defined and not performing remote login"
      end
      auth_url_params[:invite_code]  = invite_code if invite_code
      auth_url_params[:expires_in]   = expires_in  if expires_in
      "/authenticate?#{URI.encode_www_form(auth_url_params)}"
    end
def authentication_path(local_port: nil, invite_code: nil, expires_in: nil, remote: false)
      auth_url_params = {}
      if remote
        auth_url_params[:redirect_uri] = "/code"
      elsif local_port
        auth_url_params[:redirect_uri] = "http://localhost:#{local_port}/cb"
      else
        raise ArgumentError, "Local port not defined and not performing remote login"
      end
      auth_url_params[:invite_code]  = invite_code if invite_code
      auth_url_params[:expires_in]   = expires_in  if expires_in
      "/authenticate?#{URI.encode_www_form(auth_url_params)}"
    end
Build a path for master authentication

 @param local_port [Fixnum] tcp port where localhost webserver is listening
 @param invite_code [String] an invitation code generated when user was invited
 @param expires_in [Fixnum] expiration time for the requested access token
 @param remote [Boolean] true when performing a login where the code is displayed on the web page
 @return [String]