Uploaded image for project: 'OpenAM'
  1. OpenAM
  2. OPENAM-9124

FaceBook authentication module & documentation should be updated to reflect changes to FaceBook API

    Details

      Description

      If you configure FaceBook social authentication using the common task in AM, you do not get the first name, last name and other fields returned.

      This is because of a relatively recent change to the FaceBook API.

      In AM 13 the User Profile Service URL defaults to: https://graph.facebook.com/v2.1/me

      However, the FB API has changed as explained here:

      https://forgerock.org/topic/email-from-facebook-oauth-2-0-module/


      The API version of the app registered at Facebook was v2.4.
      With API 2.4, Facebook has reduced the number of fields that the API returns by default. We now need to use the
      ?fields=field1,field2 syntax to declare all the fields we want the API to return.
      More details : https://developers.facebook.com/blog/post/2015/07/08/graph-api-v2.4/

      In my particular setup I was able to get additional attributes of logged in user by setting “User Profile Service URL: ” in Facebook Module as
      https://graph.facebook.com/v2.4/me?fields=email,first_name,last_name,name,gender,link,picture

      So this should really look something like depending what fields you want returned:

      User Profile Service URL: https://graph.facebook.com/v2.4/me?fields=email,first_name,last_name,name

      This isn't mentioned in the documentation. I suggest that:

        Attachments

          Activity

            People

            • Assignee:
              jamesphillpotts James Phillpotts
              Reporter:
              wayne.blacklock Wayne Blacklock
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: