Page 5 of 6 FirstFirst ... 3456 LastLast
Results 41 to 50 of 54

Thread: New Project: Spring Social Google

  1. #41
    Join Date
    Jan 2008
    Posts
    248

    Default

    Praise is silver, contributing is gold

  2. #42
    Join Date
    Jan 2008
    Posts
    248

    Default

    I'm curious how you get the refreshToken. Adding access_type=offline to the preConnect parameters doesn't seem to do the trick for me.

  3. #43
    Join Date
    Aug 2004
    Posts
    1,067

    Default

    Marc: I replied to your question in the other thread...I figured it'd be best to continue carrying on the conversation there than to keep extending this thread.
    Craig Walls
    Spring Social Project Lead

  4. #44
    Join Date
    Jan 2008
    Posts
    248

    Default Yes

    Hey Craig,

    Yes, I realize that. I sent it here because guznik is on this thread and I figured he must have dealt with this issue.

    Cheers,
    Marc

  5. #45
    Join Date
    Jan 2008
    Posts
    248

    Default

    I'm not getting a refreshToken using the signinController but I am getting it using the connectController. I assume this is because I need to add access_type=offline to the request url. It's clear how to do this through the connect mechanism but not through the signin mechanism.

  6. #46
    Join Date
    Jan 2008
    Posts
    248

    Default

    The way around it AFAIK is to write a custom controller that offers a special signin option for Google. Not very elegant to put it mildly.

    @Controller
    @RequestMapping("/signin")
    public class MySignInController extends ProviderSignInController {

    private final ConnectSupport webSupport = new ConnectSupport();
    private final ConnectionFactoryLocator connectionFactoryLocator;

    private final MultiValueMap<String,String> googleParams = new LinkedMultiValueMap<String,String>();

    public MySignInController(
    ConnectionFactoryLocator connectionFactoryLocator,
    UsersConnectionRepository usersConnectionRepository,
    SignInAdapter signInAdapter) {
    super(connectionFactoryLocator, usersConnectionRepository, signInAdapter);
    googleParams.add("access_type", "offline");
    googleParams.add("approval_prompt", "force");
    this.connectionFactoryLocator = connectionFactoryLocator;

    }

    @RequestMapping(value="/ext/google", method=RequestMethod.POST)
    public RedirectView googleSignIn(@PathVariable String providerId, NativeWebRequest request) {
    ConnectionFactory<?> connectionFactory = connectionFactoryLocator.getConnectionFactory(prov iderId);
    try {

    return new RedirectView(webSupport.buildOAuthUrl(connectionFa ctory, request, googleParams));
    } catch (Exception e) {
    return new RedirectView(URIBuilder.fromUri("/social/signin/").queryParam("error", "provider").build().toString(),true);
    }
    }
    The only problem I have is to get this Controller to work properly. Spring keeps trying to initialize it with a no-args constructor, even when I try to exclude annotations. Infuriating.

    dispatcher-servlet.xml
    <context:component-scan
    base-package="nl.project.webapp">
    <!-- exclude controllers that are picked up by Spring Social -->
    <context:exclude-filter type="annotation" expression="nl.project.webapp.social.MySignInContr oller"/>
    </context:component-scan>

  7. #47
    Join Date
    Aug 2004
    Posts
    1,067

    Default

    I hadn't replied to your original message because I was looking into making ProviderSignInController more flexible in this regard. But as you've discovered, a more immediate option (while I sort out what to do with PSIC) is to create your own sign in controller.

    As for the exclusion problem: You've got an annotation type exclude filter, but your expression refers to MySignInController. That would only work if MySignInController were an annotation and your controller (with a different name) were annotated with it. You'll want to use one of the other filter types, such as assignable (or aspectj or regex) to exclude the controller.

    BTW, since this problem is only tangentially related to Spring Social Google, perhaps it's time to start a new thread?
    Craig Walls
    Spring Social Project Lead

  8. #48
    Join Date
    Jan 2008
    Posts
    248

    Default

    did the guznik github repo move? It's not available anymore

  9. #49
    Join Date
    Aug 2004
    Posts
    1,067

    Default

    Craig Walls
    Spring Social Project Lead

  10. #50

    Default

    Hey All,

    It looks like the latest version of spring-social-google removes a bunch of functionality like saving contacts and uploading contact photos. I see above that guznik is only working on this in his/her spare time. Does anyone know if these changes are pending soon or if I should consider implementing & submitting a push request?

    Thanks!
    Doug

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •