commit | caed4b69608dc7579d10ea709743dee0ca99170d | [log] [tgz] |
---|---|---|
author | libraryupgrader <tools.libraryupgrader@tools.wmflabs.org> | Tue Nov 26 03:47:16 2024 +0000 |
committer | libraryupgrader <tools.libraryupgrader@tools.wmflabs.org> | Wed Nov 27 01:01:28 2024 +0000 |
tree | f5055d0b2e7e881153d5c55c538e6a498c4964d0 | |
parent | d13f72bf98ff71cb555c4d498b3a68fae1b95659 [diff] |
build: Updating cross-spawn to 7.0.6 * https://github.com/advisories/GHSA-3xgq-45jj-v275 Change-Id: Ie9ffb7e575075733fda17104a75c80a22acec703
Add to the plugin to $wgPluggableAuth_Config
:
$wgPluggableAuth_Config['Log in using my SAML'] = [ 'plugin' => 'SimpleSAMLphp', 'data' => [ 'authSourceId' => 'default-sp', 'usernameAttribute' => 'username', 'realNameAttribute' => 'name', 'emailAttribute' => 'email' ] ];
data
Field name | Default | Description |
---|---|---|
authSourceId | (mandatory) | |
usernameAttribute | (mandatory) | |
realNameAttribute | (mandatory) | |
emailAttribute | (mandatory) | |
userinfoProviders | [ 'username' => 'username', 'realname' => 'realname', 'email' => 'email' ] |
By default the extension will normalize the value for username
to lowercase. If this is not desired, one can simply use the rawusername
provider. E.g.
$wgPluggableAuth_Config['Log in using my SAML'] = [ 'plugin' => 'SimpleSAMLphp', 'data' => [ ... 'userinfoProviders' => [ 'username' => 'rawusername' ], ... ] ];
If you want to modify any of the fields username
, realname
or email
before login, you can configure a custom callback for $wgSimpleSAMLphp_MandatoryUserInfoProviders
. The factory method has the following signature:
factoryCallback(): MediaWiki\Extension\SimpleSAMLphp\IUserInfoProvider
For simple usecases one can use MediaWiki\Extension\SimpleSAMLphp\UserInfoProvider\GenericCallback
:
$wgSimpleSAMLphp_MandatoryUserInfoProviders['username'] = function() { return new MediaWiki\Extension\SimpleSAMLphp\UserInfoProvider\GenericCallback( function( $attributes, $config ) { if ( !isset( $attributes['mail'] ) ) { throw new Exception( 'missing email address' ); } $parts = explode( '@', $attributes['mail'][0] ); return strtolower( $parts[0] ); } ); };