Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Go to https://developers.facebook.com/ and log in using your Facebook credentials.
  2. Navigate to the window where you can create a new app by clicking Add Click on My Apps and then click Create a New App under the Apps menu.  
    Image Added
  3. Choose the platform you wish to use. Select Website here when working with this sample.
  4. Enter the name of your new app in the window that appears and click Create New Facebook App ID.
    Image RemovedImage Added The following window appears.
    Image Removed
  5. Select if this app is a test version of another app. If you do this, you need to select the app from the dropdown instead of Category. If this is not a test version of another app, select an appropriate Category from the dropdown. 
  6. Click Confirm. This takes you to the quick start page where you can set up your app.Enter a Display Name, Contact Email and select an appropriate category from the dropdown. Click Create App ID.
    Image Added
  7. This will lead you to the quick start guide. You can view the configuration there and skip the quick start guide to access the developer dashboard. 
    Image RemovedImage Added
  8. This will take you to the app Dashboard where you can find the App ID and App Secret as shown in the image below. Click Show to view the App Secret.

    Info

    App ID is the Client ID and the App Secret is the Client Secret in OAuth terminology. The API Version is Facebook’s API that is used to create the application.

    Image RemovedImage Added

  9. Click Settings on the left menu and navigate to the Basic tab. Add the App Domains (since WSO2 IS is running on localhost, you can add localhost as the App Domain) and click Add Platform
    Image RemovedImage Added

  10. Select Website  as the platform for the application and enter the following as the site URL: https://localhost:9443. Click Save Changes
    Image RemovedImage Added
  11. Navigate to the Advanced tab. Here you need to On the left panel, click Add Product and click Get Started for a Facebook Login product. 
    Image Added

  12. You can configure the Client OAuth SettingsSettings on the window that appears.

    1. Client OAuth Login should be set to Yes.
    2. Web OAuth Login should be set to Yes.
    3. Valid OAuth redirect URIs should be set to https://localhost:9443/commonauth.
  13. Scroll down and click the Save Changes button to save the changes.

...

Info
titleAbout accessing the app

The app is not available to general public yet. To make to app available to every Facebook user, you have to submit the app for review. After a review, Facebook makes the app available to every Facebook user. You can find more information on the review process by clicking on App Review in the left navigation menu of your app's dashboard.

The review process may take some time, so for the purposes of this sample, you can specify some Facebook users as Developers or Testers. Only the users specified here can use this app to log in with Facebook until the app goes public. To do this, click on Roles in the left navigation menu of the dashboard and specify the required Facebook users as Developers or Testers.

Image RemovedImage Added

Deploying travelocity.com sample app

...

  1. Download the WSO2 Identity Server from here and run it.
  2. Log in to the Management Console as an administrator.
  3. In the Identity section under the Main tab of the Management Console, click Add under Identity Providers.
  4. Give a suitable name as the Identity Provider Name.
  5. Go to Facebook Configuration under Federated Authenticators

  6. Enter the following values in the form that appears:

    FieldDescriptionSample Value
    App IDThis refers to the Client Id you received from the Facebook app you created.<Client ID><Application ID of the Facebook App>
    App SecretThis refers to the Client Secret you received from the Facebook app you created.<Client Secret><App Secret of the Facebook App>
    ScopeDefines the permission to access particular information from a Facebook profile. See the Permissions Reference for a list of the different permission groups in Facebook APIs.  email

    User Information FieldsThese are the claims related to the user account on Facebook. WSO2 Identity Server requests these fields from Facebook when a user is authenticated with Facebook through the IS. See public_profile permission for more information about these fields. id,name,gender,email,first_name,last_name,age_range,link

  7. Select both checkboxes to Enable Facebook Authenticator and make it the Default.

  8. Click Register.

...

  1. Return to the Management Console.
  2. In the Identity section under the Main tab, click Add under Service Providers.
  3. Enter travelocity.com in the Service Provider Name text box and click Register.
  4. In the Inbound Authentication Configuration section, click Configure under the SAML2 Web SSO Configuration section.

    Now set the configuration as follows:
    1. Enter the following values:

      Panel

      Issuer: travelocity.com

      Assertion Consumer URLhttp://localhost:8080/travelocity.com/home.jsp

    2. Select the following check-boxes:

      Panel

      Enable Response Signing

      Enable Single Logout

      Enable Attribute Profile

      Include Attributes in the Response Always

  5. Click Register. Now you will be sent back to the Service Providers page.

  6. Go to the Local and Outbound Authentication Configuration section.

  7. Select the Federated Authentication radio button and select the Identity Provider you created from the dropdown list under Federated Authentication
    Image Added

  8. Click Update to save the changes.

...

  1. In the Identity section under the Main tab, click List under Identity Providers.
  2. Click Edit to edit the facebook identity provider you created. 
  3. Under Claim Configuration, go to Basic Claim Configuration.
  4. Select the Define Custom Claim Dialect option under Select Claim mapping Dialect
  5. Click Add Claim Mapping to add custom claim mappings as follows.
  6. You can retrieve all the public information of the user and the email address. The following are some common attribute names.

    Panel

    id
    email
    name
    first_name
    last_name
    link
    gender
    locale
    age_range

    More information is available from the following link: https://developers.facebook.com/docs/facebook-login/permissions/v2.0

    You can map these attributes to any Local Claim URI that is suitable.

  7. Select a suitable User ID Claim URI (e.g., email).
  8. Click Update to save changes.

...