Joomla OAuth Client Integration with Facebook Single Sign-On (SSO)
Overview
The miniOrange Joomla OAuth/OpenID Connect Single Sign-on (SSO) plugin seamlessly integrates Facebook Single Sign-on (Facebook SSO) with Joomla through the OAuth 2.0 Protocol. This enables secure and straightforward Facebook-based authentication for Joomla, allowing users to log in to the site effortlessly and access its features with their Facebook credentials. The Facebook OAuth Joomla plugin also provides advanced features such as, Auto create users, Attribute Mapping, Group Mapping etc. Visit our Joomla OAuth Client Plugin page to learn more about the features and pricing plans we offer for the Joomla OAuth Single Sign-on (OAuth & OpenID connect) plugin.
To setup OAuth Single Sign-On between Joomla and Facebook, you can also follow this step by step Setup Video.
Configuration Steps
In this configuration, Facebook functions as the OAuth server, while Joomla allows users to log in with their Facebook credentials by utilizing the Joomla OAuth Client Plugin.
Step 1: Install Joomla OAuth Client Plugin
- Login into your Joomla site’s Administrator console.
- From left toggle menu, click on System, then under Install section click on Extensions.
- Now click on Or Browse for file button to locate and install the plugin file downloaded earlier.
- Installation of plugin is successful. Now click on Get Started!
- Under Configure OAuth -> Pre-Configured Apps tab, select your OAuth Provider. You can also search for custom OAuth or custom OpenID application in the search bar, and configure your own custom provider.
- After selecting your OAuth provider, you will be redirected to the Step 1 [Redirect URL] tab. Now copy the Callback/Redirect URL which we will use to configure Microsoft Entra ID as OAuth Server, then click on the Save & Next button.
Step 2: Configure Facebook as OAuth Server
- Now login/signup to the Facebook developers dashboard.
- Go to My Apps -> Add New App.
- Click on Create app to create a new app for Joomla OAuth Client.
- Select what your app is going to work for Joomla site. Then click on Continue button.
- Enter the required details for Facebook SSO application and then click on Create App button.
- Select option Facebook Login by clicking on the Set Up button.
- Select Facebook Login -> Settings under Products option in the navigation bar.
- Select the Web option as you are trying to integrate your Facebook Login with a website.
- Next, enter the redirect URL (from your miniOrange OAuth client plugin) and click Save. Then, click Continue.
- Under Configure OAuth tab, enter the Callback/Redirect URL (from your miniOrange Joomla OAuth Client plugin) in the Valid OAuth Redirect URIs field. Click on the Save button to save your configurations. Most importantly, your Callback/Redirect URI should be https and not http. It is mandatory while configuring Facebook as an OAuth Server.
Step 3: Configure Client ID & Secret
- Go to Settings -> Basic to view your App Id and App Secret (Refer to the image below).
- Enter your Privacy Policy URL in the respective field and choose a category from the dropdown in the Category field. Also enter the terms of service URL and User deletion URL in the given fields. Then, click on Save Changes button to save your configurations
- Copy your App ID and App Secret which is your Client ID and Client Secret and save it in your miniOrange OAuth Client Plugin.
- Change you app status from In Development to Live by clicking on OFF as shown in the image below. Then, click on Confirm to confirm your change of status.
- Go back to your Joomla Dashboard. Then go to Step 2 [Client ID & Secret].
- Paste the Client ID, Client Secret and Domain. Also Set Client Credentials In header then click on Save Settings. Once Settings are saved then click on Save Configuration.
- Scope & Endpoints are given below, which are required for configuring Joomla as OAuth Client plugin to configure Facebook as a custom OAuth or OIDC provider.
Scope | public_profile email |
Authorize Endpoint | https://www.facebook.com/dialog/oauth |
Access Token Endpoint | https://graph.facebook.com/v2.8/oauth/access_token |
Get User Info Endpoint | https://graph.facebook.com/me/?fields=id,name,email,age_range,first_name,gender,last_name,link |
Set Client Credentials | In Both (In Header and In Body) |
Step 4: Configure Attribute Mapping
- User Attribute Mapping is mandatory for enabling users to successfully login into Joomla. We will be setting up user profile attributes for Joomla using below settings.
- Go to Step 3 [Attribute Mapping] tab and click on Test Configuration button.
- You will be able to see the attributes in the Test Configuration output as follows.
- Now go to the Step 3 [Attribute Mapping] tab and Select the attribute name for Email and Username from dropdown. Then click on Finish Configuration button.
Step 5: Setup Login/SSO URL
- Now go to Step 4 [SSO URL] tab, here copy the Login/SSO URL and add it to your Site by following the given steps.
- Now logout and go to your Joomla site's pages where you have added this link. You will see a login link where you placed that button. Click on this button to perform SSO.