Access WordPress and Moodle with single user credential
Single Sign On for Edwiser Bridge
Current Version 1.2.1
WordPress Version 4.4.2 upto 4.8
Edwiser Bridge Version 1.2.3
WooCommerce Version 2.5.5 upto 3.1.1
Moodle Version 3.0.3 upto 3.3.1
PHP version 5.6 upto 7.1
- Single Sign On Installation on WordPress
- License Key Activation on WordPress
- Single Sign On Installation on Moodle
- Single Sign On Extension User Guide
- Single Sign On Extension Hooks & Filters
Single Sign On Extension Installation on WordPress
NOTE: Make sure that your PHP is version 5.6 or greater.
- Upon purchasing the Single Sign On Extension for Edwiser Bridge, an email containing the purchase receipt, download links, and license key will be sent to your registered email id. You can download the extensions using the download link provided.
- The email contains the download links for two zip files – ‘edwiser-bridge-sso.zip’ and ‘wdmwpmoodle.zip’.
- The ‘edwiser-bridge-sso.zip’ is the plugin file that has to be installed on the WordPress website.
- To install this plugin, go to the ‘Plugins’ menu from the dashboard.
- Click on the ‘Add New’ button on this page.
- Now click on the ‘Upload Plugin‘ button and upload the ‘edwiser-bridge-sso.zip’ file.
- Click on ‘Install Now’ button once you have located and uploaded the plugin.
- On successful installation click the ‘Activate Plugin’ link to activate the plugin.
- Alternatively, you can unzip and upload the Single Sign On Extension plugin folder using the FTP application of your choice.
License Key Activation
- Once you have activated the plugin go to Edwiser Bridge > Settings > “Licenses” tab.
- A new option labeled as ‘Single Sign On License’ will be created under this tab.
- Enter the license key provided in the purchase email in the ‘License Key’ field and click the ‘Activate License’ button.
- Every license issued is a single site license. You cannot use it on more than one website simultaneously.
- If you need to migrate the plugin from your staging site to your live site you will have to first deactivate license key from the staging site and then use the same key on the live site.
Single Sign On Extension Installation on Moodle
- The ‘wdmwpmoodle.zip’ file will have to be installed on the Moodle website.
- To do so you will have to log in to the Moodle website and navigate to ‘Site Administration’ -> ‘Plugins’ -> ‘Install Plugins’.
- Once here upload the ‘wdmwpmoodle.zip’ file using the ‘Choose a file’ button alongside the ‘Zip package’ field.
- Choose ‘Authentication method (auth)’ from the drop-down list provided against the ‘Plugin type’ field. The ‘Rename the root directory’ field can be left blank.
- Now click the ‘Install plugin from the ZIP file’ button.
- Enable the Single Sign On extension on Moodle by navigating to ‘Site Administration’ -> ‘Plugins‘ -> ‘Authentication’ -> ‘Manage Authentication’ and enable the Edwiser Bridge SSO plugin.
- The last step in the installation process of Single Sign On is adding the “wdm_sso_verify_token” service in your external service. To do so, go to ‘Site Administration’ -> ‘Plugins‘ -> ‘Web Services‘ -> ‘External Services‘. Here, click on the “Functions” button beside the external service which was earlier created for Edwiser Bridge. Click on “Add Functions” and search and add the “wdm_sso_verify_token” service in this list.
Single Sign On Extension User Guide
Defining a Secret Key on WordPress and Moodle
- Once you have installed the extension on WordPress as well as Moodle on both the websites a secret key will have to be set that will facilitate the Single Sign-On process.
- To set the secret key on the WordPress website navigate to ‘Edwiser Bridge‘ -> ‘Settings‘ -> ‘Single Sign On‘ tab from the admin menu and set a secret key of your choice in ‘Secret Key‘ field under the ‘Login Redirect URL‘ field. Save the changes once you are done.
- Now the same secret key should be set on the Moodle website. To set the secret key on Moodle, log in to your Moodle website and navigate to ‘Site Administration‘ -> ‘Plugins‘ -> ‘Authentication‘ -> ‘Edwiser Bridge SSO‘. On clicking ‘Edwiser Bridge SSO‘, the following screen will appear on the right side of your screen.
- Here you will have to enter the same secret key that you entered in the ‘Secret Key‘ field in the Single Sign-On settings on the WordPress website and save the settings.
Including a Login Link on the WordPress Website with a Shortcode
- The Single Sign On extension for Edwiser Bridge allows users to enter their login credentials once in WordPress and be logged in to WordPress and Moodle simultaneously.
- Now it can happen that an end user logs out of the Moodle website. For these users, you can provide a login link on the WordPress website which can be used to automatically login to the Moodle website again without having to enter any login credentials.
- To use the shortcode on your WordPress website create a page and add this shortcode to the page.
- Now use the link of the page that you just created to any menu item that you might want to use to automatically login the user to Moodle and redirect them there.
Setup WordPress log in redirection:
- If you want your users to redirect to Moodle site as soon as they log in from your WordPress site using the WooCommerce My Account login page (www.example.com/my-account), then, go to Edwiser Bridge → Settings → Single Sign On Tab and add your Moodle site’s address or a WordPress page which consists the [wdm_generate_link] shortcode.
Setup Reverse SSO (Automatic login/logout on WordPress site if a User logs in/logs out on Moodle):
- Go to your Moodle site and browse Site Administration → Plugins → Authentication → ‘edwiser bridge sso’. Here, add the complete WordPress site URL in the following section.
Moodle logout Redirection:
- If you want your users to redirection to a certain page after he logs out of Moodle, then please add the logout redirection URL in the following section.
Hooks and Filters
|eb_sso_login_url||Use this filter to redirect a user to a specific page after logging in to the WordPress website.||$url: URL of th page you want to redirect the user to after logging in to the WordPress website|
|eb_sso_logout_url||Use this filter to redirect a user to a specific page after logging out from the WordPress website.||$url: URL of th page you want to redirect the user to after logging out from the WordPress website|
Last Update on 22nd July 2017
= 1.2.1 =
* Feature – Compatibility with Moodle 3.3 and above.
* Tweak – Single Sign On WordPress settings moved from General Settings to Connection Settings page of Edwiser Bridge plugin.
* Fix – Updated License code.
* Fix – SSO Settings in Moodle plugin not visible on Moodle version 3.3 and above.
= 1.2 =
* Feature – Trigger WordPress login when users logs into moodle.
* Feature – Trigger WordPress logout when users logs out from moodle.
* Feature – Moodle dashboard setting to redirect on a specific page after logout.
* Feature – WordPress dashboard setting to redirect on a specific page after login.
* Feature – Translation ready.
* Feature – Added a button in Dashboard to verify WordPress Secret Key with Moodle Secret Key.
* Tweak – Optimized plugin.
* Tweak – Updated licensing code.
* Tweak – If query argument `redirect_to` or `redirect` is set in login URL, then redirect users to that specified URL.
* Tweak – WooCommerce MyAccount page login – redirect to the same page itself i.e. MyAccount page.
* Fix – Users redirecting to Homepage when they log in on WooCommerce’s checkout page.
* Fix – Notice “undefined constant HTTP_REFERER”
* Fix – Even after saving Secret Key at moodle end, it does not show the entered secret key.
= 1.1.0 =
* Tweak – Single Sign On license key presented inside the “licenses” tab in Edwiser Bridge
* Tweak – Refactored & optimized whole plugin codebase using tools like PHPCS, PHPCBF & PHPMD.
= 1.0.0 =
* Plugin Launched
Frequently Asked Questions
I am Interested in the Single Sign On Extension
The Single Sign On Extension extension requires at least WordPress version 3.0.1 and has been tested up to the version stated under the plugin details.
Single Sign On is an extension of the Edwiser Bridge plugin. Hence, the Edwiser Bridge plugin will have to be installed on your website before you get started. You can download your free copy of Edwiser Bridge from wordpress.org.
I have some license related questions
Every license you purchase is valid for one year, during which you will receive free support and updates. After the license expires you will still be able to use the plugin, but will not receive support or updates. To continue receiving support and updates, you will have to renew the license at 30% discount.
The license for the Single Sign On extension is valid only for a single website.
No. The license key that is provided in the purchase receipt is only for the plugin that will be installed on WordPress.
The license is active on the staging site. I now want to activate it on my live site. What should I do?
Each license can be used only on a single website. If you are already using the license on your staging site and want to now use it on your live site, go to Plugins –> Single Sign On License and deactivate the plugin from your staging site. Now use the same license key on your live site.
The license key is associated with the Single Sign-On extension that will be installed on the WordPress website. To enter the license key here you will have to navigate to ‘Plugins‘ -> ‘Single Sign On License‘ in the admin menu of your WordPress website.
Sometimes the license key does not get activated because the ” curl_exec ” PHP file is not enabled in your WordPress. Once you have enabled this file your license key will be activated.
I am Using the Single Sign On Extension
There could be two possible reasons for this to happen:
- You have not set the secret key on WordPress and Moodle: If this is the case then refer to the documentation to learn how to set the secret keys on both websites.
- You do not have the mcrypt extension activated on both WordPress and Moodle: Install and enable mcrypt extension on both websites to resolve this issue.
- The issue could be due to file permissions related to the directory and files in SSO. (Ideally, the “Directory” access permission should be set at 755 and the “Files” access permission should be set at 644)