code: @Override
    public Access authenticate() {
      try {
        JSONObject user = new JSONObject();
        user.put("id", mUserId);
        user.put("password", mPassword);
        JSONObject password = new JSONObject();
        password.put("user", user);
        JSONArray methods = new JSONArray();
        methods.add("password");
        JSONObject identity = new JSONObject();
        identity.put("methods", methods);
        identity.put("password", password);
        JSONObject project = new JSONObject();
        project.put("id", mProjectId);
        JSONObject scope = new JSONObject();
        scope.put("project", project);
        JSONObject auth = new JSONObject();
        auth.put("identity", identity);
        auth.put("scope", scope);
        JSONObject requestBody = new JSONObject();
        requestBody.put("auth", auth);
        HttpURLConnection connection =
            (HttpURLConnection) new URL(mAuthUrl).openConnection();
        connection.setDoOutput(true);
        connection.setRequestProperty("Accept", "application/json");
        connection.setRequestProperty("Content-Type", "application/json");
        OutputStream output = connection.getOutputStream();
        output.write(requestBody.toString().getBytes());
        HttpStatusChecker.verifyCode(STATUS_CHECKERS, connection.getResponseCode());
        final String res;
        try (final BufferedReader bufReader =
            new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
          res = bufReader.readLine();
        }
        JSONParser parser = new JSONParser();
        JSONObject jsonResponse = (JSONObject) parser.parse(res);
  
        String token = connection.getHeaderField("X-Subject-Token");
        PasswordScopeAccess access = new PasswordScopeAccess(jsonResponse, token,
            mPrefferedRegion);
        connection.disconnect();
        return access;
      } catch (IOException | ParseException e) {
        LOG.error(e.getMessage());
        throw new CommandException("Unable to execute the HTTP call or to convert the HTTP Response",
                e);
      }
    }
docs: Authentication logic
  
  @return Access JOSS access object