Configure Apple Single Sign-On (SSO) with Joomla OAuth Client Plugin
Overview
Single Sign-On (SSO) with Apple in Joomla uses OAuth Authorization to provide users secure access to the Joomla
site. With our Joomla OAuth Single Sign-On (SSO) plugin, Apple acts as the OAuth provider, ensuring secure login for
Joomla websites.
The integration of Joomla and Apple simplifies and secures the login process using OAuth protocol. This solution
allows users to access their Joomla sites with Single Sign-On (SSO) using their Apple credentials, completely
removing the need to store, remember, and reset multiple passwords.
In addition to offering OAuth Single Sign-On (SSO) using Apple credentials, the plugin also provides advanced SSO
features like user profile attribute mapping, role mapping, and Azure multi-tenant login and providing site access
based on organization email domains. For further insights into the array of features we offer within the Joomla
OAuth & OpenID Connect Client plugin, kindly visit our page here. You can
follow the below steps to setup Apple OAuth SSO with Joomla.
Configuration Steps
In this configuration, Apple functions as the OAuth server, while Joomla allows users to log in with their Apple 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 Apple as OAuth Server, then click on the Save & Next button.
Step 2: Configure Apple as OAuth Server
- First of all, go to https://developer.apple.com click on Account and Login with your Apple developer account.
- Click on Certificates, Identifiers & Profiles tab.
- In the left menu Click on Identifiers and after that click on the Plus Icon(blue color) . Click on Continue for the next 2 pages.
- Enter Description and Bundle ID for the App ID. (The Bundle ID should be in reverse-dns style string.)
- In the Capabilities section scroll down and select sign with apple and Click on Edit link.
- Select Enable as a primary App Id and click on Save. Click on Continue and then click on Register.
- In the right corner click on Continue and after that Register button.
- Again click the Plus icon( blue color). Select Service IDs and click on Continue.
- Enter Description and Identifier( Identifier would be your client id). and click on the Continue and after that Register button.
- Click on Keys tab from the left menu.Click on the Plus icon to register a new key.
- Give your Key a name, and select Sign In with Apple and click on Configure button.
- Select your Primary Id and click on the Save button and after that at the right corner click on Continue and Register button.
- Click on the Download button once the key is downloaded click on the Done button.
- In the left menu click on Identifiers and the right top click on App IDs.
- Click on Service IDs from the drop down menu.
- Select your Service Id from the List.
- Select Sign In with Apple and click on Configure button.
- Select the Primary App Id from the drop down, and Enter the Domain and Redirect URL in Domains and Subdomains and Return URLs respectively and click on the Next button (You will get the Domain name and Redirect URL from miniOrange plugin).
- Verify the details and click on the Done button. After that at the right corner click on the Continue button.
- Copy the Identifier value and click on the Save button.
- Enter the Identifier value in the Client ID and copy the downloaded key value in Client secret of the miniOrange OAuth Client plugin.
Step 3: Configure Client ID & Secret
- Download the Ruby installer from the following link https://rubyinstaller.org/downloads/ and then install it.
- Search for the Start command prompt with ruby open the ruby command prompt andinstall the JWT gem by running the following command on the command line:gem install JWT.
- Copy the below code in a file and save the file with the .rb extension. Keep this .rb fileand downloaded .p8 file in the same folder.
- Enter the name of downloaded file example= "key.P8", key_id , client_id, team_id in the code
- Open Ruby command prompt and run the above code using the following command ruby filename.rb
require 'jwt'key_file = 'key.P8'
team_id = ''
client_id = ''
key_id = ''
ecdsa_key = OpenSSL::PKey::EC.new IO.read key_file
headers = {
'kid' => key_id
}
claims = {
'iss' => team_id,
'iat' => Time.now.to_i,
'exp' => Time.now.to_i + 86400*180,
'aud' => 'https://appleid.apple.com',
'sub' => client_id,
}
token = JWT.encode claims, ecdsa_key, 'ES256', headers
puts token
- Go to the Step 2 [Client ID & Secret] tab of the Joomla OAuth Client plugin, here paste the Client ID, Client Secret and Tenant. Click on the Save Configuration button.
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.