Results 1 to 8 of 8

Thread: New Facebook Canvas Sample

  1. #1
    Join Date
    Aug 2004
    Posts
    1,099

    Default 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 at 10:12 AM.
    Craig Walls
    Spring Social Project Lead

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

    Default

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

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

    Default

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

  4. #4
    Join Date
    Mar 2013
    Location
    Bangalore
    Posts
    8

    Default

    Thanks for the informatiion and Good luck

  5. #5
    Join Date
    Sep 2008
    Posts
    15

    Default

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

  6. #6
    Join Date
    Sep 2008
    Posts
    15

    Default

    Quote 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

  7. #7
    Join Date
    May 2013
    Posts
    2

    Default

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

  8. #8
    Join Date
    May 2013
    Posts
    2

    Lightbulb



    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>

Posting Permissions

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