Release status: stable
|Description||Extends the PluggableAuth extension to provide authentication using Shibboleth.|
|Author(s)||Attila Laszlo (n0rthwaytalk)|
|Latest version||v1.0.0-rc.1 (2018-03-05)|
|Translate the Shibboleth extension if it is available at translatewiki.net|
|Check usage and version matrix.|
- Download and place the file(s) in a directory called
- Add the following code at the bottom of your LocalSettings.php:
wfLoadExtension( 'Shibboleth' );
- Configure as required
- Done! Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Values must be provided for the following mandatory configuration variables:
|$wgShibboleth_Username||no default value||The name of the attribute to be used for the user's username.|
|$wgShibboleth_Email||no default value||The name of the attribute to be used for the user's email address.|
|$wgShibboleth_DisplayName||no default value||The name of the attribute to be used for the user's real name.|
|$wgShibboleth_Logout_Base_Url||no default value||Single Logout (SLO) base URL|
|$wgShibboleth_Logout_Target_Url||no default value||Single Logout (SLO) target URL|
In addition, the following optional configuration variable is provided:
|$wgShibboleth_GroupMap||null||Mapping from SAML attributes to MediaWiki groups of the form: |
No group mapping is performed if $wgShibboleth_GroupMap is null.
Use case: your SAML IdP reads groups from LDAP or Database and stores this information inside an attribute of the SAML response. You want to use this to map MediaWiki groups to users belonging to some known groups given by your IdP.
- Your IdP sends an attribute named "groups" with a list of names like "administrator", "student", "teacher", ... in the SAML response after authentication.
- All users that have the value "administrator" in the "groups" attribute shall be mapped to the MediaWiki "sysop" group to give them admin rights within your MediaWiki instance.
- Create a group map in your LocalSettings.php as follows: $wgShibboleth_GroupMap = array('attr_name' => 'groups','sysop' => 'administrator',);
You can come up with rather complex mappings that fit your needs. If you have more than one attribute from SAML, just add it to the array with the array of values you like to map.
Hint: If a user belongs to a MediaWiki group that is no longer mapped to that user (for example, by losing the group membership in the SAML user data source), the user will be removed from that MediaWiki group at next log in. In that way you can mass remove groups from SAML and their memberships, too - just scramble the mapping values so they don't match the SAML response, but don't mess up the MediaWiki group name.
Single Logout (SLO)
Shibboleth Single Logout (SLO) URL structure:
$wgShibboleth_Logout_Base_Url . Shibboleth.sso/Logout?return= . $wgShibboleth_Logout_Target_Url
The very first time when the user authenticates with Shibboleth, $wgShibboleth_GroupMap does not take effect due T184736 bug. It requires a relogin (logout then login) to be able to map the given configuration. (Fixed in latest version of PluggableAuth)