title: Create Spreadsheet using Google Spreadsheet API in Google drive in Java
body: <p>I had created some tool which was populating the google spreadsheet.
  It was working fine for 1 year, since today I've error </p>
  
  <pre><code>Exception in thread "main" com.google.gdata.util.AuthenticationException: Error authenticating (check service name)
  at com.google.gdata.client.GoogleAuthTokenFactory.getAuthException(GoogleAuthTokenFactory.java:688)
  at com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(GoogleAuthTokenFactory.java:560)
  at com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials(GoogleAuthTokenFactory.java:397)
  at com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:364)
  at com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:319)
  at com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:303)
  </code></pre>
  
  <p>This is the part of code to connect with gmail:</p>
  
  <pre><code>String USERNAME = "usename@........com"; -&gt;of course I'm using proper username and password
      String PASSWORD = "*******";
      SpreadsheetService service
              = new SpreadsheetService("SandboxCheck");
      service.setUserCredentials(USERNAME, PASSWORD);
  </code></pre>
  
  <p>I don't know how to connect with gmail, I was trying to do this via oAuth but I don't know how to do this. In examples on <a href="https://developers.google.com/google-apps/spreadsheets/authorize">https://developers.google.com/google-apps/spreadsheets/authorize</a> there is only code for .net.</p>