Announcement Announcement Module
Collapse
No announcement yet.
New Project: Spring Social Google Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • New Project: Spring Social Google

    Hi,

    I started the Spring Social Google project here: https://github.com/guznik/spring-social-google

    It is very limited in functionality right now - you can only fetch your e-mail, profile details and contact list, but more functionality will be added over time.

    Your feedback is appreciated.

  • #2
    That's awesome! I know that there's quite a bit of interest in a Spring Social module for Google.

    I'll take a closer look at your work soon, but for now I noticed that the connection support is based on OAuth 2. Very good move! I know that Google also supports OAuth 1, but as I recall from having looked at it awhile back, their OAuth 1 implementation was a bit unusual. So, I'm happy to see that you chose to go with OAuth 2.

    The big challenge with a Google module is that Google has *SO* many APIs, so building out the API binding will be a big undertaking. But it's a great start and is obviously it'll be good to plug in the Google+ API binding in here when Google finally publishes the Google+ API.

    Comment


    • #3
      Awesome. I have a weird problem with using the library. Whenever I register the connectionFactory, Eclipse reports the providerId as facebook when it should be (and judging by the source code is) "google".
      I'm thinking it may have something to do with the fact that I use compile time weaving and the SocialConfig class is marked @Configurable. Any clue about how to deal with this?

      Comment


      • #4
        Nope, I decompiled the GoogleConnectionFactory.class in the supplied jar and it actually does contain "facebook" as providerId. I suggest you update this on your github repo. Might avoid some confusion

        Comment


        • #5
          Sorry, I forgot to exclude "target" from source control, and it's content is not up to date. Actually this is my first Git project, so I'm learning on the way. I hope to make some significant progress during the weekend and will try to fix up the repository.

          Comment


          • #6
            Here is my version of spring social google. It uses OAuth 2.0 authorization flow and implements google portable contacts API. There's also a skeleton for adding more APIs. Hope it will help you.

            Comment


            • #7
              Thanks Zagum.

              I took a look at the Portable Contacts API and it was empty for me, and I figured it may be the case for most users at this time, so I started with the "old" contacts API. I'll look at your code to see how to integrate parts of it with what I started.

              Comment


              • #8
                I keep getting access denied. I'm sure the credentials are correct and the originating url also. I'm wondering if it has something do with the redirect url? I have set this to http://www.mydomain.com/connect/google
                Any suggestions?

                Comment


                • #9
                  mschipperheyn, the example application is configured to work either from http://localhost:8080/ or from http://gdata.cloudfoundry.com/
                  The logic that determines the profile is in EnvironmentInitializer, and the environment-specific configuration classes are CloudfoundryConfiguration and LocalhostConfiguration. If you want to run the example on another domain (different protocol, hostname or port), you will have to register a new application with Google as described here and switch to the new client ID and secret.

                  Comment


                  • #10
                    I'm using this in my own context with my own googe api configuration, clientId and secret. I still keep getting Access Denied. The same code is working correctly for Twitter, Facebook and LinkedIn.
                    I've tried this both on my development server and development environment. Everything seems to be correctly configured. Any other ideas why this might not be working?

                    My auth url looks like this
                    https://accounts.google.com/o/oauth2...in%2Fgoogle%2F [fake id]

                    The redirect url in Google Api looks like this
                    http://www.acc.mydomain.com.br/connect/google/

                    Comment


                    • #11
                      The redirect URI you send is /signin/google , and it should be the same as the one configured in the Google API console - /connect/google

                      Comment


                      • #12
                        Hi ! Great initiative.

                        I've ran samples and everyting seems to work as expected, but facing an issue when integrating your quickstart project into spring-social-showcase: the redirect url is built without scope attribute. I've tested such generated url (using my custom client/private ids) and works if I manually add the scope attribute.

                        Do you have any clue ?

                        Regards.

                        Comment


                        • #13
                          Hi Gabriel,

                          Thanks for the quick reply. I've made the changes in the Google API Console but still no joy. Is there any way to get more info on why it's not working? Access denied is a pretty limited piece of info.

                          Cheers,
                          Marc

                          Comment


                          • #14
                            Originally posted by jstorni View Post
                            Hi ! Great initiative.

                            I've ran samples and everyting seems to work as expected, but facing an issue when integrating your quickstart project into spring-social-showcase: the redirect url is built without scope attribute. I've tested such generated url (using my custom client/private ids) and works if I manually add the scope attribute.

                            Do you have any clue ?

                            Regards.
                            It works. Was just a CTRL-C + CTRL-V silly error.

                            Comment


                            • #15
                              Runtime error NoSuchMethodError:org.springframework.web.client.R estTemplate

                              I've built the quickstart example using mvn clean, then mvn install. I dropped the war file into tomcat 7. When I attempt to login, I get the following exception when the oauth callback is invoked:


                              java.lang.NoSuchMethodError: org.springframework.web.client.RestTemplate.setInt erceptors([Lorg/springframework/http/client/ClientHttpRequestInterceptorV
                              org.springframework.social.oauth2.ProtectedResourc eClientFactory.create(ProtectedResourceClientFacto ry.java:36)
                              org.springframework.social.oauth2.AbstractOAuth2Ap iBinding.<init>(AbstractOAuth2ApiBinding.java:56)
                              org.springframework.social.google.api.impl.GoogleT emplate.<init>(GoogleTemplate.java:31)
                              org.springframework.social.google.connect.GoogleSe rviceProvider.getApi(GoogleServiceProvider.java:15 )
                              org.springframework.social.google.connect.GoogleSe rviceProvider.getApi(GoogleServiceProvider.java:7)
                              org.springframework.social.connect.support.OAuth2C onnection.initApi(OAuth2Connection.java:132)
                              org.springframework.social.connect.support.OAuth2C onnection.<init>(OAuth2Connection.java:71)
                              org.springframework.social.connect.support.OAuth2C onnectionFactory.createConnection(OAuth2Connection Factory.java:58)
                              org.springframework.social.connect.web.ConnectSupp ort.completeConnection(ConnectSupport.java:127)
                              org.springframework.social.connect.web.ProviderSig nInController.oauth2Callback(ProviderSignInControl ler.java:162)


                              I also noticed that the war file did not contain the localhost.properties file which I've manually added to the exploded war file. (I've updated the properties file to use my own client id and secret).
                              The war file has the following jar files:

                              aopalliance-1.0.jar
                              cglib-nodep-2.2.jar
                              cloudfoundry-runtime-0.6.0.jar
                              commons-io-2.0.1.jar
                              commons-logging-1.1.1.jar
                              dom4j-1.6.1.jar
                              h2-1.3.158.jar
                              jackson-core-asl-1.8.5.jar
                              jackson-mapper-asl-1.8.5.jar
                              javax.inject-1.jar
                              jaxen-1.1.1.jar
                              jdom-1.0.jar
                              jstl-api-1.2.jar
                              jstl-impl-1.2.jar
                              spring-aop-3.1.0.BUILD-20110905.072223-365.jar
                              spring-asm-3.1.0.BUILD-20110905.072138-367.jar
                              spring-beans-3.1.0.BUILD-20110905.072215-365.jar
                              spring-context-3.1.0.BUILD-20110905.072231-365.jar
                              spring-context-support-3.1.0.BUILD-20110905.072326-364.jar
                              spring-core-3.1.0.BUILD-20110905.072159-365.jar
                              spring-expression-3.1.0.BUILD-20110905.072208-365.jar
                              spring-jdbc-3.1.0.BUILD-20110905.072303-364.jar
                              spring-security-crypto-3.1.0.RC2.crypto.jar
                              spring-social-core-1.0.0.RC3.jar
                              spring-social-google-0.0.1-SNAPSHOT.jar
                              spring-social-web-1.0.0.RC3.jar
                              spring-tx-3.1.0.BUILD-20110905.072239-365.jar
                              spring-web-3.1.0.BUILD-20110905.072310-364.jar
                              spring-webmvc-3.1.0.BUILD-20110905.072340-364.jar
                              xalan-2.7.0.jar
                              xercesImpl-2.8.0.jar
                              xml-apis-1.3.03.jar
                              xom-1.2.5.jar


                              Does anything look amiss in terms of the libraries being pulled in? Any suggestions are appreciated.

                              Thank you,
                              David

                              Comment

                              Working...
                              X