Single Sign-On into Salesforce with Joomla as OAuth Server
Overview
If you want to login to your Salesforce site using your Joomla username and password, you can simply do it
using our
Joomla OAuth Server plugin. Once you configure the Salesforce with Joomla OAuth Server plugin, you can
login to your
Salesforce application using Joomla credentials. It also allows you to send custom user attributes to your
Salesforce site as per your requirements.
To know more about other features we provide in Joomla OAuth Server plugin, you can click here.
Configuration Steps
Step 1: Install Joomla OAuth Server 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 Start Using miniOrange OAuth Server plugin.
- Under the Configure OAuth tab, click on the ADD button.

Step 2: Configure Salesforce
- Login to your SalesForce account.
- Switch to the SalesForce Classic mode from profile menu.

- Navigate to the Setup page.

- Search for Auth under the search bar in the left navigation panel.
- Click on Auth Provider.

- Click on the New button.

- From the Provider Type dropdown, select Open ID Connect.

- Enter the Application name under the Name text field and copy the generated URL Suffix.

- Navigate to the Salesforce dashboard and paste the copied Client ID under the Consumer Key text field.

- Paste the copied Client Secret into the Consumer Secret text field.

- Go to the developer account of Salesforce and Configure the Salesforce as an OAuth client using the below details.
Client ID:
You can get the Client ID from Configure OAuth Tab in Joomla OAuth Server
|
Client Secret:
You can get the Client Secret from Configure OAuth Tab in Joomla OAuth
Server
|
Scope:
email profile
|
Authorize Endpoint:
https://< your-Joomla-domain >/index.php
|
Access Token Endpoint:
https://< your-Joomla-domain >/index.php
|
Get User Info Endpoint:
https://< your-Joomla-domain>
/plugins/system/miniorangeoauth/miniorangeoauthserver.php
|

- Click on the Automatically create a registration handler template link.

- Click on the Search icon next to the Execute Registration Handler As text box.

- Select the Admin account from the list of users.

- Click on the Save button.

- Now, click on the AutocreatedRegHandler link next to the Registration Handler.

- Click on the Edit button.

- Remove the existing code, paste the following code, and click on the Save button.
global class AutocreatedRegHandlerMoDrupal implements Auth.RegistrationHandler{ global User createUser(Id portalId, Auth.UserData data){ User u = new User(); Profile p = [SELECT Id FROM profile WHERE name='Chatter Moderator User']; u.username = data.email.split('@')[0] + '@miniorange_drupal.com'; u.email = data.email; u.lastName = 'Unknown'; u.firstName = 'Unknown'; u.languagelocalekey ='en_US'; u.localesidkey = 'en_US'; u.emailEncodingKey = 'UTF-8'; u.alias = (data.email.split('@')[0].length() > 8) ? data.email.split('@')[0].substring(0, 8) : data.email.split('@')[0]; u.timeZoneSidKey = 'America/Los_Angeles'; u.profileId = p.Id; insert u; return u; } global void updateUser(Id userId, Id portalId, Auth.UserData data){ User u = new User(id=userId); u.email = data.email; update(u); } }

- Please confirm that the Callback URL you previously entered in Drupal matches the one provided here. If there was a different configuration earlier, please update it to match the URL provided here.

- In the left navigation panel search for My Domain and click on it.

- Scroll down to the Authentication Configuration section and click on the Edit button.

- Enable the checkbox next to the Application configured under the Authentication Service section and click on the Save button.

Step 3: Configure Joomla as OAuth Server
- Now go to the Configure OAuth tab, and enter the Client Name and Redirect URL in the respective fields.
- Then click on the Save Client button.

- Under the List of OAuth Client's table, copy the Client ID and Secret of your Client. Go to your OAuth client and paste the Client ID and Secret in the respective fileds.

- Congratulations, you have successfully configured Joomla as your OAuth Server.