Facebook Social Identity Provider

Note

As of October 2018, Facebook as a social identity provider requires access over secure HTTP (HTTPS).

Set Up Facebook

To set up Facebook as a social identity provider, navigate to the Facebook for Developers page. You'll need a Facebook account. While you could use a personal Facebook account, it is best to use an organizational account to avoid problems if specific individuals leave your organization. When you set up a Facebook social identity provider, you'll need to perform the following tasks:

  • In the Facebook for Developers page, select My Apps and Add a New App. For IDM, you'll create a Website application.

  • You'll need to include the following information when creating a Facebook website application:

    • Display Name

    • Contact Email

    • IDM URL

  • When complete, you should see your App. Navigate to Basic Settings.

  • Make a copy of the App ID and App Secret for when you configure the Facebook social identity provider in IDM.

  • In the settings for your App, you should see an entry for App Domains, such as example.com, as well as a Website Site URL, such as https://idm.example.com/.

For Facebook's documentation on the subject, see Facebook Login for the Web with the JavaScript SDK.

Configure a Facebook Social Identity Provider

  1. To configure a Facebook social identity provider, log in to the Admin UI and navigate to Configure > Social ID Providers.

  2. Enable the Facebook social identity provider.

  3. Include the values that Facebook created for App ID and App Secret, as described in "Set Up Facebook".

  4. Under regular and Advanced Options, include the options shown in the following appendix: "Facebook Social Identity Provider Configuration Details".

When you enable a Facebook social identity provider in the Admin UI, IDM generates the identityProvider-facebook.json file in your project's conf/ subdirectory.

It includes parts of the file that you may have configured through the Admin UI. While the labels in the UI specify App ID and App Secret, you'll see them as clientId and clientSecret, respectively, in the configuration file.

{
   "provider" : "facebook",
   "authorizationEndpoint" : "https://www.facebook.com/dialog/oauth",
   "tokenEndpoint" : "https://graph.facebook.com/v2.7/oauth/access_token",
   "userInfoEndpoint" : "https://graph.facebook.com/me?fields=id,name,picture,email,first_name,last_name,locale"
   "clientId" : "<someUUID>",
   "clientSecret" : {
       "$crypto" : {
           "type" : "x-simple-encryption",
           "value" : {
             "cipher" : "AES/CBC/PKCS5Padding",
             "stableId" : "openidm-sym-default",
             "salt" : "<hashValue>",
             "data" : "<encryptedValue>",
             "keySize" : 16,
             "purpose" : "idm.config.encryption",
             "iv" : "<encryptedValue>",
             "mac" : "<hashValue>"
           }
       }
   },
   "scope" : [
       "email",
       "user_birthday"
   ],
...

You should also see UI settings related to the social identity provider icon (badge) and the sign-in button, described in "Social Identity Provider Button and Badge Properties".

You'll see links related to the authenticationIdKey, redirectUri, and configClass; the location may vary.

The file includes schema information, which includes properties for each social identity account, as collected by IDM, as well as the order in which it appears in the Admin UI. When you've registered a user with a Facebook social identity, you can verify this by selecting Manage > Facebook, and then selecting a user.

Another part of the file includes a propertyMap, which maps user information entries between the source (social identity provider) and the target (IDM).

If you need more information about the properties in this file, refer to the following appendix: "Facebook Social Identity Provider Configuration Details".

Configure User Registration to Link to Facebook

Once you've configured the Facebook social identity provider, you can activate it through User Registration. To do so in the Admin UI, select Configure > User Registration, and under the Social tab, enable the option associated with Social Registration. For more information about user self-service features, see "Self-Service End User UI".

When you enable social registration, you're allowing users to register on IDM through all active social identity providers.

Facebook Social Identity Provider Configuration Details

You can set up the Facebook social identity provider through the Admin UI or in a conf/identityProvider-facebook.json file. IDM generates the identityProvider-facebook.json file when you configure and enable this social identity provider in the Admin UI. Alternatively, you can create the file manually.

The following table includes the information shown in the Admin UI Facebook Provider pop-up window, along with associated information in the identityProvider-facebook.json file:

Facebook Social Identity Provider Configuration Properties
Property (UI)Property (JSON file)Description
App IDclientIdThe client identifier for your Facebook App
App SecretclientSecretUsed with the App ID to access the applicable Facebook API
ScopescopeAn array of strings that allows access to user data; see Facebook's Permissions Reference Documentation.
Authorization EndpointauthorizationEndpointFor Facebook's implementation, see their documentation on how they Manually Build a Login Flow.
Token EndpointtokenEndpointEndpoint that receives a one-time authorization code, and returns an access token. For Facebook's implementation, see their documentation on how they Manually Build a Login Flow.
User Info EndpointuserInfoEndpointEndpoint that transmits scope-related fields through Facebook's API. The default endpoint includes the noted field properties as a list, as defined in Facebook's Permissions Reference.
Not in the Admin UInameName of the Social ID provider
Not in the Admin UItypeAuthentication module
Not in the Admin UIauthenticationIdAuthentication identifier, as returned from the User Info Endpoint for each social identity provider
Not in the Admin UIpropertyMapMapping between Facebook and IDM

For information on social identity provider buttons and badges, see "Social Identity Provider Button and Badge Properties".

Read a different version of :