OAuth2 Authentication: Log In With Facebook Account

Intermediate

17 Dec 2015   Integration

This entire manual refers to a feature that was added in version 4.16.1

To understand OAuth 2.0 authentication, consider the following example of Facebook authentication integrated within Squiz Matrix, in order to allow users to log into the system using their Facebook account.

  1. First, create a new testing application on your Facebook account at the Facebook Developers site. You will receive the application ID and secret.

    Make sure the URL of your site is defined when configuring the Facebook application.

  2. Create an OAuth2 Token asset.
  3. On the Details screen, enter the ID and Secret provided to you by Facebook in the Client ID and Client Secret fields.
  4. In the Authorisation Endpoint field, enter https://graph.facebook.com/oauth/authorize.
  5. In the Token Endpoint field, enter https://graph.facebook.com/oauth/access_token.
  6. Create an OAuth Account Manager asset.
  7. On the Details screen, select the OAuth2 Token asset that was created earlier in the OAuth 2.0 Token field.
  8. In the User Profile API field, enter https://graph.facebook.com/me.
  9. On the Create Locations screen, specify the location where new user assets will be created.

Log out of your system and preview the OAuth Account Manager. The Facebook log in page will be displayed, as shown in the figure below.

Facebook Authentication
Logging into Facebook 

Once a user has successfully authenticated their account, they will be redirected back to Squiz Matrix, where they will be able to link this OAuth account with an existing user account or create a new user within the system to link with.