docs: static public LoginOutput openSession(LoginInput loginInput)
    throws SFException, SnowflakeSQLException
    {
      AssertUtil.assertTrue(loginInput.getServerUrl() != null,
                            "missing server URL for opening session");
  
      AssertUtil.assertTrue(loginInput.getAppId() != null,
                            "missing app id for opening session");
  
      AssertUtil.assertTrue(loginInput.getLoginTimeout() >= 0,
                            "negative login timeout for opening session");
  
      final ClientAuthnDTO.AuthenticatorType authenticator = getAuthenticator(
          loginInput);
      if (!authenticator.equals(ClientAuthnDTO.AuthenticatorType.OAUTH))
      {
        // OAuth does not require a username
        AssertUtil.assertTrue(loginInput.getUserName() != null,
                              "missing user name for opening session");
      }
      if (authenticator.equals(ClientAuthnDTO.AuthenticatorType.EXTERNALBROWSER))
      {
        // force to set the flag.
        loginInput.sessionParameters.put(CLIENT_STORE_TEMPORARY_CREDENTIAL, true);
      }
      else
      {
        // TODO: patch for now. We should update mergeProperteis
        // to normalize all parameters using STRING_PARAMS, INT_PARAMS and
        // BOOLEAN_PARAMS.
        Object value = loginInput.sessionParameters.get(
            CLIENT_STORE_TEMPORARY_CREDENTIAL);
        if (value != null)
        {
          loginInput.sessionParameters.put(
              CLIENT_STORE_TEMPORARY_CREDENTIAL, asBoolean(value));
        }
      }
  
      boolean isClientStoreTemporaryCredential = asBoolean(
          loginInput.sessionParameters.get(CLIENT_STORE_TEMPORARY_CREDENTIAL));
      LoginOutput loginOutput;
      if (isClientStoreTemporaryCredential &&
          (loginOutput = readTemporaryCredential(loginInput)) != null)
      {
        return loginOutput;
      }
      return newSession(loginInput);
    }