Announcement Announcement Module
Collapse
No announcement yet.
Add extra parmition Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment

    Working...
    X