Results 1 to 3 of 3

Thread: spring-social-google & access_type offline

  1. #1

    Default spring-social-google & access_type offline

    Hey All,

    I'm not sure if this is the best place to ask this but I've been trying out spring-social-google (https://github.com/guznik/spring-social-google) and so far it seems great. One permission I'd like to request from the user is access_type offline. It's similar to Facebook's offline_access scope except it's not a scope. Instead, it's a parameter that is appended to the authentication url. I can hack the GoogleOAuth2Template to add the parameter, but it seems like there should be a way to pass it from the sign in form.

    Is there a *right* way to do this?

    Thanks!
    Doug

  2. #2

    Default

    Hey All,

    It looks like the way that you convert web request parameters to ConnectionFactory specific OAuth parameters is to use a ConnectInterceptor. What if the GoogleConnectionFactory always added a ConnectInterceptor to the ConnectController that would looks for Google Specific web parameters and if it finds them it adds them to the OAuthParameters.

    Is this clean? Is there a better way to get connection specific parameters from a web request and add them to the authorization url?

    Thanks!
    Doug

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

    Default

    The ConnectInterceptor is the best way to do that kind of thing. At one time I had considered adapting ConnectController and ProviderSignInController to allow for arbitrary parameters, but set that aside because I determined that the ConnectInterceptor approach seemed best for those provider-specific parameters.

    Now the question is whether or not the GoogleConnectionFactory could automatically add a ConnectInterceptor to do the job so you wouldn't have to do that. I could certainly see Spring Social Google providing a ready-to-configure implementation of such an interceptor so you wouldn't have to write the implementation yourself. Having the connection factory involved in wiring up such a bean, however, isn't so clear to me. That seems a bit out of the connection factory's area of responsibility.
    Craig Walls
    Spring Social Project Lead

Posting Permissions

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