Results 1 to 7 of 7

Thread: Cannot see TwitterSignInController in the git repository

Hybrid View

  1. #1
    Join Date
    Mar 2011
    Posts
    4

    Default Cannot see TwitterSignInController in the git repository

    I am not able to find the TwitterSignInController in the git repository even though the XML file signin.xml refers to it. This controller is present in the M2 downloaded.

    Can anyone please let me know if the version in Git is not the latest one?

    Warm regards,
    Abhinav

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Hi,
    We're working on M3 where TwitterSignInController is no longer required. It's been replaced in favor of a general-purpose ProviderSignInController. We're in in the process of updating the samples right now.

    Keith
    Keith Donald
    Core Spring Development Team

  3. #3
    Join Date
    Mar 2011
    Posts
    4

    Default

    Hi Keith,

    Thanks for pointing that out to me. I have one more question that is unrelated, but hope you can give me some direction.

    I am leading an open source called socialauth that aims to provide a common API for the common functionality exposed by providers like facebook, twitter and several others. I wanted to integrate it with spring-social so that users can take advantage of additional providers that are not supported with spring-social. Also I do not want to rewrite all providers that we have developed. So we are trying to write a single provider class that will be a wrapper of our own providers. Single class because we just have one interface called AuthProvider that we implement for every provider.

    The problem we are facing is regarding connection factories. Since our providers are already coded and do not expose any access token or secret, I wanted to develop a connection factory of our own. Is this possible?

    Secondly, in the ConnectController it checks instanceof OAuth connection factory so its not possible to plugin our own connection factory into the controller. Will that code be changed in M3 ? Have studied the code of spring-social to quite an extent but am really hoping for any guidance. Thanks a lot in advance for some of your time.

    Warm regards,
    Abhinav

  4. #4
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Yes you can create your own ServiceProviderConnectionFactories and you could look to extend ConnectController to create ServiceProviderConnections using your custom factories. Let me know if ConnectController needs to be better written for extension (it probably does).

    Keith
    Keith Donald
    Core Spring Development Team

  5. #5
    Join Date
    Mar 2011
    Posts
    4

    Default

    Hi Keith,

    Thanks for your response. We have managed to integrate our framework with spring-social but for couple of inelegant bits.

    1. We developed a SocialAuthConnectionFactory that implements ServiceProviderConnectionFactory. However, as you pointed out we had to place another else block in ConnectController. But to better write the ConnectController, the change actually needs to happen in ConnectionFactory hierarchy. It is possible to write an OAuthConnectionFactory, that is extended by both OAuth1ConnectionFactory and OAuth2ConnectionFactory in such a manner that ConnectController does not need to refer to instanceof.

    2. Currently, the MapServiceProviderConnectionFactoryRegistry has two methods, one for FindByProviderId and another FindByServiceApi. The problem is that what we intend to implement is a common ServiceApi for all providers, so the serviceApiIndex does not work. We got around this problem by having our own registry which only implements FindByProviderId. We also had to modify the example classes like TwitterShowcaseController to use FindByProviderId instead of FindByServiceApi. This works, so I wanted to know if FindByServiceApi is really needed ?

    I am happy to send you modified code for both the changes, would you like to take a look?

    Warm regards,
    Abhinav

  6. #6
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    I'd definitely like to see your code mods... if those could be made available in a github fork of spring-social, that'd be excellent.

    Anything we can explore to reduce the provider-specific logic in ConnectController I think is a good thing, so I'm very interested in that. As far as findByServiceApi, this is used to support type-safe lookup of Connections to specific Service API interfaces needed by application developers. I think this is a useful thing where it's simply not possible to rely on a common service API abstraction that applies across all providers. After all, there is quite a lot in each provider's API that is truly provider specific yet still needed for use by applications. In our model, the ServiceProviderConnection instance is designed to play the role of that common API with the help of the ServiceApiAdapter SPI. You can see that with the definition of common methods getUser(), test(), sync(), refresh(), and updateStatus(String message). I'm curious what else your own auth framework adds beyond these "common operations". My intention would be to have other truly common stuff added to ServiceProviderConnection, while provider-specific stuff can still be obtained via a call to getServiceApi(), then by invoking the strongly-typed provider-specific Java API binding interface.

    Let me know when you have the code up on github in a forked spring-social repo and we'll take a look!

    Keith
    Keith Donald
    Core Spring Development Team

Posting Permissions

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