commit | 3a21d246357db5d6839f5629fa75a17715d0d57b | [log] [tgz] |
---|---|---|
author | libraryupgrader <tools.libraryupgrader@tools.wmflabs.org> | Sat Aug 24 09:23:02 2024 +0000 |
committer | libraryupgrader <tools.libraryupgrader@tools.wmflabs.org> | Sun Aug 25 10:56:46 2024 +0000 |
tree | b47f9229d9b3774b3d500dc9c57b11429ebfff9c | |
parent | 99cb05442eb9e84be13b8f99a1a12752c457ff0f [diff] |
build: Updating micromatch to 4.0.8 * https://github.com/advisories/GHSA-952p-6rrq-rcjv Change-Id: I289b513d46a728a4648255933da8f02ff57d17ce
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] ); } ); };