OAuth2 Authentication: Log In With Facebook Account
17 Dec 2015
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.
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.
- Create an OAuth2 Token asset.
- On the Details screen, enter the ID and Secret provided to you by Facebook in the Client ID and Client Secret fields.
- In the Authorisation Endpoint field, enter https://graph.facebook.com/oauth/authorize.
- In the Token Endpoint field, enter https://graph.facebook.com/oauth/access_token.
- Create an OAuth Account Manager asset.
- On the Details screen, select the OAuth2 Token asset that was created earlier in the OAuth 2.0 Token field.
- In the User Profile API field, enter https://graph.facebook.com/me.
- 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.
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.