Monday, April 9, 2012

Spring Social Google First Milestone Is Out

I'm happy to announce that the first milestone of Spring Social Google is out! Since the project started I received a lot of feedback from the community that helped shape this milestone and I would like to thank everyone who helped with suggestions, bug reports, patches and kind words.

This milestone includes integration with Google+, Portable Contacts and Google Tasks. It also lets you integrate with the GData Java Client Library, letting you use Spring Social Google for authentication and authorization, and applying the OAuth2 access token to an instance of a GData client. Please see the reference manual for usage instructions.

The example application demonstrates most of the available functionality. You can see it in action here.

To use Spring Social Google in a maven project, add the following repository and dependency to your pom.xml :

    <name>Spring Social Google</name>



or download the JAR here.

The project roadmap mostly depends on community feedback. Integration with more Google APIs will be added and you can help decide which will be first, so let me know what you think.

Enjoy using Spring Social Google!


  1. Hi,I find that the emails of googleplus's friends are always null.May be the reason is that the portable contacts do not return email address.And Google now suggest Contacts V3 to replace the portable Contacts. Can you add it?

  2. Hi Gerald,

    Actually I started with GData Contacts V3, but it had its own problems, to name a few: the contact and group IDs are specific to the logged in user, the picture URL requires authentication, and working with Atom is very cumbersome.

    Indeed Google+ API is not complete yet, and Google Portable Contacts has been deprecated. Google considers using PoCo format for the Contacts and G+ APIs, and when it does I will update the library.

    If you want to work with GData API, you may integrate Google's Java client libraries with Spring Social Google by instantiating a subclass of Service (eg. ContactsService) and sending it to Google.applyAuthentication() method.

  3. Thanks for your suggestion, I will try integrating GData and Spring Social Google.

  4. Hi,
    Thanks for the great work. I am running into a slight problem.
    If I want to make un-authenticated calls to Google+ I can instantiate an GoogleTemplate with the default constructor. However, when I try to access any public info, I get a 403 forbidden error.

    I was wondering that in the case of un-authenticated access, one still needs to provide the API key. But I cant figure out how that is accomplished.


  5. Thanks for this release.
    I'm using this version of spring-social-google but when I make an activities search I'm getting null Content, when I do "List activityList = page.getItems();" all Activity objects in List doesn't have content property. I post a more detailed description of this in

    Could you help me with this?

  6. Hi, I can't seem to access email addresses from Persons anymore. Also getting 404s on open social endpoints, so I'm assuming that they are end of life. Just wondering how to get the email addresses from Persons that you retrieve through your network (or gmail inbox)

    1. Hi mschipperheyn,
      To work with Google Contacts, use GData Java Library, and you can use Google.applyAuthentication() to use Spring Social's authentication mechanism with it.

    2. Ok, I had a look at that. Not the most user friendly library. I'm also not entirely sure why this isn't part of Spring Social Google anymore. Is there a specific reason for using GData to do parts of the interaction with Google or is it more of an "I haven't gotten around to it yet"

    3. I decided to include integration only to new JSON-based APIs. At the time PoCo was in experimental stage and I hoped it would become stable but it got deprecated, so it's out of the library too.
      The GData APIs are so much more complex than the new JSON ones (understand that it's not the Java library that is complex, it's the API itself) that I didn't see a benefit in integrating with them (after working with them for a while), and providing a generic integration with the GData Java library seems like the best solution.

    4. Right, it's a shame really that the ease of use of the library on some key features (for me) has disappeared. Some small code examples to get started would be appreciated. Thanks

    5. There is an example in the manual for use of applyAuthentication() use it with GData Contacts Java library.

  7. Hi Garbiel,

    Love your work. Currently trying to use the DriveOperations component of library.

    public DriveFile upload(Resource resource, DriveFile metadata, UploadParameters parameters)

    I'm not a Spring GURU, but how can we easily convert a file uploaded via [input type="file"] to a Spring Resource?

    Some code examples would be greatly appreciated. Happy to contribute it back to doco/quickstart

    1. Hi SurtaX,

      The most convenient way in my opinion to do upload with SpringMVC is to add MultipartFile parameter to your controller method. MultipartFile has getBytes() and getInputStream() methods which you can use with the constructors of ByteArrayResource and InputStreamResource.

      <input type="file" name="myfile"/>

      public void uploadMethod(MultipartFile myfile) {
      Resource resource = new InputStreamResource(myfile.getInputStream());

    2. Brilliant. I'll give that a go, thanks for the response!

      Again thanks for the awesome work. Having lots of fun with Spring Social Google :D

    3. Arghh sorry to trouble you again. But I'm hitting into a Mimetype issue when trying to upload. Here's my code and server log:
      Resource resource = new InputStreamResource(uploadItem.getFileData().getInputStream());
      DriveOperations drive = google.driveOperations();
      UploadParameters params = new UploadParameters();
      DriveFile.Builder builder = new DriveFile.Builder();
      builder.setTitle("Test FileName").setDescription("description").setMimeType("application/octet-stream");
      drive.upload(resource,, params);

    4. java.lang.NullPointerException

      at javax.activation.MimetypesFileTypeMap.getContentType(
      at org.springframework.http.converter.ResourceHttpMessageConverter$ActivationMediaTypeFactory.getMediaType(
      at org.springframework.http.converter.ResourceHttpMessageConverter.getDefaultContentType(
      at org.springframework.http.converter.ResourceHttpMessageConverter.getDefaultContentType(
      at org.springframework.http.converter.AbstractHttpMessageConverter.write(
      at org.springframework.http.converter.FormHttpMessageConverter.writePart(
      at org.springframework.http.converter.FormHttpMessageConverter.writeParts(
      at org.springframework.http.converter.FormHttpMessageConverter.writeMultipart(
      at org.springframework.http.converter.FormHttpMessageConverter.write(
      at org.springframework.http.converter.FormHttpMessageConverter.write(
      at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(
      at org.springframework.web.client.RestTemplate.doExecute(
      at org.springframework.web.client.RestTemplate.execute(
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(
      at java.lang.reflect.Method.invoke(
      at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(

  8. I recently saw an oauth popup that in stead of the standard Google version contained a Google+ specific version, allowing you to notify friends in certain circles etc. I wonder if something like this is possible with spring social google?

    1. I assume you are referring to App Activities, or Moments ( ), and yes I am working on this for the coming milestone.

  9. Hi there,

    The link to the example application on github and the link to the live example gives a 404 error? Are they available from somewhere else?

  10. Hi,

    is this project still currently mantained?

  11. I am using spring social,in this facebook and twitter apis are creating/updating record in userconnection table but this google api doesn't,and providinng error not connected to goole.
    can u please tell me the reason?

  12. I admit, I have not been on this web page in a long time... however it was another joy to see It is such an important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues. Buy Nagative Google Reviews

  13. Great post full of useful tips! My site is fairly new and I am also having a hard time getting my readers to leave comments. Analytics shows they are coming to the site but I have a feeling “nobody wants to be first”. social work recruitment agency

  14. I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. tips to grow followers

  15. I might want to thank you for the endeavors you have made in composing this article. I am trusting the same best work from you later on too.. centrifugal pump

  16. A debt of gratitude is in order for imparting decent data to us. I like your post and all you share with us is exceptional and very enlightening, I might want to bookmark the page so I can come here again to peruse you, as you have made a magnificent showing. en uygun uçak bileti

  17. I havent any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. Ngwa Visa Canada

    It's fantastic for me to have a website that is beneficial to my understanding. Thank you, admin.

  19. I was eager to find this page. I needed to thank you for ones time for this especially awesome read!! I certainly truly preferred all aspects of it and I likewise have you book-set apart to look at new data in your blog.

    home insurance quotes

  20. If you bet on "red," you win if the ball comes to relaxation in one of many red pockets. The 666 strategy certainly one of the|is among the|is doubtless considered one of the} roulette methods you must to} avoid at all costs. It's an expensive way to play roulette (you want at least of|no less than} $66 per spin) and it 다 파벳 우회 주소 would not provide great possibilities to win. Although these roulette bets don't result in mind-blowing wins, preserving your bets on the odds/even, red/black, and high/low gives you the best possibilities to attain a win. It might sound unimportant but, when you play roulette games at a brick-and-mortar on line casino, it's good follow to certain you|ensure you|be positive to} get together with the other players already within the sport. All of them provide free and actual money roulette games and, most significantly, all of them have been vetted by the PokerNews editorial team.