Announcement Announcement Module
Collapse
No announcement yet.
New Facebook Canvas Sample Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • New Facebook Canvas Sample

    Due to the high interest in using Spring Social within Facebook Canvas apps, I've just pushed a newer version of the Spring Social Canvas sample that properly uses signed_request to obtain an access token. The example can be found at https://github.com/SpringSource/spri...-social-canvas.

    The previous version of the sample was going through a typical OAuth 2 authorization flow using ProviderSignInController. While that works, it's not optimal, nor is it the proper way to handle authorization in Canvas applications.

    Per Facebook's Canvas Application documentation (https://developers.facebook.com/docs...book/tutorial/ ), the proper way to obtain an access token is by retrieving it from the signed_request parameter that Facebook sends to your app's Canvas URL. If no access token is in the signed_request parameter, then your app should redirect (at the browser's top-level) to Facebook's authorization dialog to obtain authorization, after which Facebook will redirect back to your application with a new signed_parameter that should include the access token.

    This is what the new Spring Social Canvas Sample does. Most of the work is handled in CanvasSignInController, which is roughly analogous to ProviderSignInController only with the proper Canvas authorization flow.

    Note that this is just a first cut of the sample and there's a lot of improvements to be made. I wanted to make this available sooner rather than later, even if it is a bit rough around the edges. It is likely to evolve over time. Specifically, CanvasSignInController is subject to be extracted from the example altogether and become a component in Spring Social Facebook's Web module. What you see in that class is already mostly boilerplate, so it makes sense to make it a portion of the framework.
    Last edited by habuma; Feb 8th, 2013, 11:12 AM.

  • #2
    Note that I'm temporarily pinning this thread to the top of the forum to make sure it is seen. I will unpin it in a few weeks.

    Comment


    • #3
      Update: I've just extracted CanvasSignInController from the Spring Social Canvas example and have made it a part of Spring Social Facebook's Web module. This greatly simplifies the creation of working with Spring Social in Facebook Canvas applications, removing all of the boilerplate code needed to authorize and obtain the access token. Now you simply configure a CanvasSignInController in your application and it takes care of the rest.

      This is still considered a work in progress, so some properties might change names and additional properties might appear. Feedback is much appreciated.

      Comment


      • #4
        Thanks for the informatiion and Good luck

        Comment


        • #5
          I don't see CanvasSigninController in Facebook Web Module 1.0.2 release. Do you know why?

          Comment


          • #6
            Originally posted by asajnani View Post
            I don't see CanvasSigninController in Facebook Web Module 1.0.2 release. Do you know why?

            I see it in M 2 release. Thanks

            Comment


            • #7
              Originally posted by asajnani View Post
              I see it in M 2 release. Thanks
              I need the exact version to use the CanvasSigninController.

              I have tried with

              <dependency>
              <groupId>org.springframework.social</groupId>
              <artifactId>spring-social-facebook</artifactId>
              <version>1.1.0.M2</version>
              </dependency>
              <dependency>
              <groupId>org.springframework.social</groupId>
              <artifactId>spring-social-web</artifactId>
              <version>1.1.0.M2</version>
              </dependency>

              Note able to see the CanvasSigninControllerhelp is much appreciated, Thanks.

              Comment


              • #8


                I got it i have added <dependency>
                <groupId>org.springframework.social</groupId>
                <artifactId>spring-social-facebook-web</artifactId>
                <version>1.1.0.M2</version>
                </dependency>

                Comment


                • #9
                  Is there a simple way to create an app that can work inside and outside a facebook canvas?

                  The optimal for me would be to be able to use both the CanvasSigninController and the SocialAuthenticationFilter, so that when the app is run outside facebook it asks to signin.

                  Is it possible?

                  Comment


                  • #10
                    OMG
                    http://forum.springsource.org/showth...ot-Working-%28

                    Comment

                    Working...
                    X