[go: up one dir, main page]

build: Updating micromatch to 4.0.8

* https://github.com/advisories/GHSA-952p-6rrq-rcjv

Change-Id: I289b513d46a728a4648255933da8f02ff57d17ce
1 file changed
tree: b47f9229d9b3774b3d500dc9c57b11429ebfff9c
  1. i18n/
  2. includes/
  3. src/
  4. tests/
  5. .eslintrc.json
  6. .gitignore
  7. .gitreview
  8. .phpcs.xml
  9. CODE_OF_CONDUCT.md
  10. composer.json
  11. COPYING
  12. extension.json
  13. Gruntfile.js
  14. package-lock.json
  15. package.json
  16. README.md
README.md

Extension:SimpleSAMLphp

Configuration (since 5.0)

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'
	]
];

Fields for data

Field nameDefaultDescription
authSourceId(mandatory)
usernameAttribute(mandatory)
realNameAttribute(mandatory)
emailAttribute(mandatory)
userinfoProviders[
  'username' => 'username',
  'realname' => 'realname',
  'email' => 'email'
]

User info providers

Example: "Case sensitive username"

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'
		],
		...
	]
];

Define custom user info provider

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] );
        } );
    };