Results 1 to 7 of 7

Thread: Spring Social One Web App with Multiple Facebook Apps

  1. #1
    Join Date
    Feb 2012
    Posts
    6

    Default 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 at 04:07 AM.

  2. #2
    Join Date
    Aug 2004
    Posts
    1,074

    Default

    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?
    Craig Walls
    Spring Social Project Lead

  3. #3
    Join Date
    Feb 2012
    Posts
    6

    Default

    Quote 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

  4. #4
    Join Date
    Apr 2009
    Location
    Ahmedabad, Gujarat, India
    Posts
    15

    Default

    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.
    Regards,
    Jigar Modi
    (Sun Certified Java Programmer)
    (Sun Certified Web-Component Developer)

  5. #5
    Join Date
    Feb 2012
    Posts
    6

    Default

    Quote 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.

  6. #6
    Join Date
    Aug 2004
    Posts
    1,074

    Default

    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.
    Craig Walls
    Spring Social Project Lead

  7. #7
    Join Date
    Feb 2012
    Posts
    6

    Default

    Quote 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.
    [Oracle Certified professional(OCP) Java SE 6 Programmer]

Tags for this Thread

Posting Permissions

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