Results 1 to 2 of 2

Thread: Add extra parmition

  1. #1
    Join Date
    Dec 2009
    Posts
    2

    Default Add extra parmition

    Hello,

    I was looking into spring social example, but can not figure out how do I add extra permissions from facebook, like offline access etc...

    Any suggestion?


    Regards

  2. #2
    Join Date
    Apr 2011
    Posts
    15

    Default

    you pass in one extra param to the oauth url like so
    scope=offline_access

    and if you need more permission say posting on their wall you would use a comma to add extra permissions
    scope=publish_stream,offline_access,manage_pages

    if it's in backend and you are using ConnectController then make sure scope is set in the request parameter with the permissions you need since ConnectController does this before calling oauth
    String scope = request.getParameter("scope");


    so wherever you are calling to your ConnectController to do the initial oauth request you would pass in scope to that guy like so:

    /connect/facebook?scope=offline_access

    now if you need to modify the spring social showcase app to have extra params then take a look at facebookConnect.jsp in
    SpringSource-spring-social-samples\spring-social-showcase\src\main\webapp\WEB-INF\views\connect

    and you will see this hidden input in that jsp which is
    <input type="hidden" name="scope" value="publish_stream,offline_access" />
    so you can modify it here to add additional params if you are using the spring social example.

Posting Permissions

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