Announcement Announcement Module
Collapse
No announcement yet.
Spring Social One Web App with Multiple Facebook Apps Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Social One Web App with Multiple Facebook Apps

    Hi,
    I have a Spring based J2EE project which should be the bacend for several Facebook apps. Now it is works with only one Facebook app. In the XML config there is:
    Code:
        <bean id="connectionFactoryLocator"
            class="org.springframework.social.connect.support.ConnectionFactoryRegistry">
            <aop:scoped-proxy proxy-target-class="false" />
            <property name="connectionFactories">
            	<list>
                	      <bean
                    	  class="org.springframework.social.facebook.connect.FacebookConnectionFactory">
                        	      <constructor-arg value="${facebook.clientId}" />
                            	  <constructor-arg value="${facebook.clientSecret}" />
                      	</bean>
            	</list>
            </property>
        </bean>
    
    	<bean id="usersConnectionRepository"
    		class="org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository">
    		<constructor-arg ref="dataSource" />
    		<constructor-arg ref="connectionFactoryLocator" />
    		<constructor-arg ref="textEncryptor" />
    		<property name="tablePrefix" value="test_" />
    	</bean>
    How should I modify my config to works with multiple Facebook AppId/AppSecret pairs not just with one?
    Site setups contains the specific appId and appSecrets so we know at runtime from the Site which appId we should use for creating the Facebook connection, just how can we solve the inserting into userconnection and other things around the multiple nost just one application problem?
    The config must be XML based in this project. I think in the userconnection SQL table we have to add an extra column: appId because the standard userconnection table works with just one app.
    Last edited by sandocan; Aug 9th, 2012, 04:07 AM.

  • #2
    This is not currently possible (at least not with the out of the box implementation). It's not the typical use-case and I'd think that the connection process could even confuse the end-user (didn't I already authorize this app to do that?).

    I'm curious: What is the motivation for having a single web app that presents itself as multiple clients of Facebook's API?

    Comment


    • #3
      Originally posted by habuma View Post
      This is not currently possible (at least not with the out of the box implementation). It's not the typical use-case and I'd think that the connection process could even confuse the end-user (didn't I already authorize this app to do that?).

      I'm curious: What is the motivation for having a single web app that presents itself as multiple clients of Facebook's API?
      Our J2EE application is a multilanguage CMS which serves different countries and we would like to add the "Login with Facebook" Feature for it. If we create one Facebook app, we can add the "About the app" and other datas just in one language. It is not good for us. It is neccesarry that the user view the Facebook app's Auth dialog in his/her language. The entry point, where is the "Login with Facebook" button is localized so at this point we know which Facebook App we should use, because the Appid/Appsecret is connected for "sites". have you got any ide how can we do this with Spring Social?

      Thanks.
      Adam

      Comment


      • #4
        Hi sandocan,

        You should create one configuration file in which key will be country and value will be relative app id. At the time of creating oauth or facebook-session fetch id with related country value.

        We have done this environment specific. in dev and qa env we are using diff-diff app id and secret.

        Comment


        • #5
          Originally posted by Jigar86 View Post
          Hi sandocan,

          You should create one configuration file in which key will be country and value will be relative app id. At the time of creating oauth or facebook-session fetch id with related country value.

          We have done this environment specific. in dev and qa env we are using diff-diff app id and secret.

          Thanks.
          Could you attach code snippets? In dev and qa env we use different appid and secrets now too, but we would like to use for example 30 different appid and secret pairs on dev env at the same time.

          Comment


          • #6
            Are you sure that you can't setup multiple languages for a single FB app? Facebook has fairly decent localization support. In the application configuration (at FB), look at the Localize item in the left-hand menu. It requires a bit of setup for each of the languages, but I can't imagine that setup being as complex as managing multiple appIDs.

            Comment


            • #7
              Originally posted by habuma View Post
              Are you sure that you can't setup multiple languages for a single FB app? Facebook has fairly decent localization support. In the application configuration (at FB), look at the Localize item in the left-hand menu.
              Thank you for your help! Maybe it will good for us.

              Comment


              • #8

                We are working on a similar project. We manage a few hundred websites. We would like to provide social connect feature to these sites via our CRM platform. This means we only have one webapp that will service all the sites and each site needs to have its own pair of facebook appid/secret so that is customized to that site. How can we do this in spring social?

                Thanks
                Tom

                Comment

                Working...
                X