Using Facebook OAuth key-secret Configuration Guidelines

What?

Use Facebook as 3rd party application for registering a new user or logging into ODS DataSpace as already registered ODS User which account is associated with a given Facebook account.

Why?

Makes the process of managing users register/log in activities easier.

How?

In order to be able to register a new user or to log in into ODS Dataspace as already registered ODS user, you need to:

When the above is done, you can perform the following activities in ODS:

Examples

Prerequisites

Steps for Configuring Facebook API Key and Secret Key
1 -- Get Facebook API Key and Secret Key for use with ODS
  1. Browse to <https://developers.facebook.com/apps> and enter your Facebook use credentials:







  2. Click on Create New App:







  3. In the presented form:
    1. Enter application name, for ex. "MyODSExample"



    2. Click "Continue".
    3. Enter captch string:



    4. Click "Continue":
    5. The application should be registered and you will be shown a API ID and Secret for the newly registered application. You can copy these now as you will need these in the steps that follow:



  4. Provide a Callback URL -- Click on "Website with Facebook Login" and enter your ODS site URL that should match the host of the ODS installation. For ex. if ODS runs at http://example.com/ods/ then the URL in the Facebook app should be http://example.com.com/ :



  5. Click "Save Changes".



2 - Configure ODS to use your Facebook Consumer Key and Secret
  1. Browse to your Virtuoso + ODS instance, http://<cname>[:<port>]/ods, e.g., <http://example.com/ods/>, and click Sign In.



  2. Log in as a Virtuoso+ODS user with Administrator privileges, e.g., dba.



  3. Click on Site Settings:



  4. Click on Login Authentication Keys:



  5. Select FacebookAPI in the API Name menu, provide the API Key and Secret from the new Facebook application you created above, and click Add.



  6. ODS is now configured to use Facebook.



Example for Configuring regular ODS user to log in into ODS using Facebook Account credentials

Here is a sample scenario how to configure a regular ODS user to be able to log in in its ODS Dataspace using his/her own Facebook Account:

  1. Browse to your Virtuoso + ODS instance, http://<cname>[:<port>]/ods, e.g., <http://example.com/ods/>.



  2. Log in as a Virtuoso+ODS user with normal privileges, e.g., demo.



  3. Go to Profile Edit->Personal->Online Accounts:



  4. Click "Add":



  5. In the presented form select service Facebook. By default the "Member Home Page URI" has http://www.facebook.com/<your-ODS-user-name> and the "Account URI" has value http://host:port/about/id/entity/http/www.facebook.com/<your-ODS-user-name>#this . You need to change the <your-ODS-user-name> from these URLs with your Facebook account name.



  6. Finally click "Save".
  7. Log out from ODS DataSpace.
  8. Make sure Facebook Login is enabled from admin user available at Site Settings -> Members Registrations:



  9. Click Sign In.
  10. Go to "Facebook" tab:



  11. Click "Facebook Login".
  12. Facebook should ask you to for authorization for the created application from above:



  13. Click "Log In with Facebook":



  14. On a successful authorization you should be redirected back to the ODS DataSpace:



  15. Click "Facebook Login" and should be logged in as the regular user from above, e.g: user "demo".



Related