@Override
  protected Integer doInBackground(Void... params) {
    Log.d(TAG, "Authenticating user from " + VM_SERVER_ADDRESS);
    try {
      URL url = new URL(VM_SERVER_ADDRESS);
      HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();

      try {
        urlConnection.setDoOutput(true);
        urlConnection.setDoInput(true);
        urlConnection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
        urlConnection.setRequestProperty("Accept", "application/json");
        urlConnection.setRequestProperty("Authorization", "Token token=" + accessToken.getToken());
        urlConnection.setRequestMethod("POST");

        String json = new Gson().toJson(accessToken, AccessToken.class);

        OutputStreamWriter out = new OutputStreamWriter(urlConnection.getOutputStream());
        out.write(json);
        out.close();

        int httpResult = urlConnection.getResponseCode();

        InputStream in = new BufferedInputStream(urlConnection.getInputStream());
        String httpResponseStream = ZZZUtility.convertStreamToString(in);

        if (httpResult == HttpURLConnection.HTTP_OK) {

          Log.d(TAG, httpResponseStream);
          user =
              new HHUserFullProcess(
                  new Gson().fromJson(httpResponseStream, HHUserFullNested.class));
          HHAuthToken = urlConnection.getHeaderField("Authorization");
          return httpResult;

        } else if (httpResult == HttpURLConnection.HTTP_ACCEPTED) {

          return httpResult;

        } else {
          Log.e(TAG, "HTTP ERROR! " + httpResult);
        }
      } finally {
        urlConnection.disconnect();
      }
    } catch (MalformedURLException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }

    return HttpURLConnection.HTTP_NOT_ACCEPTABLE;
  }