Hi,
I am trying to configure SAML auth for our Wiki 1.39.4 on RHEL7.9. I am trying with simplesamlphp 2.0.5. While accessing the wiki, it gives error :
"Could not load authentication plugin"
wiki 1.39.4
php 8.0
pluggableauth 7.0
SimpleSAMLphp: 7.0
From LocalSettings.php :
wfLoadExtension( 'PluggableAuth' );
wfLoadExtension( 'SimpleSAMLphp' );
$wgSimpleSAMLphp_InstallDir = '/var/simplesamlphp';
$wgSimpleSAMLphp_AuthSourceId = 'default-sp';
$wgPluggableAuth_EnableAutoLogin = true;
$wgPluggableAuth_EnableLocalLogin = false;
$wgPluggableAuth_EnableLocalProperties = false;
$wgPluggableAuth_ButtonLabelMessage = 'Login';
$wgPluggableAuth_Class = 'SimpleSAMLphp';
$wgMainCacheType = CACHE_DB;
$wgSimpleSAMLphp_MandatoryUserInfoProviders['myusername'] = [
'factory' => function() {
return new \MediaWiki\Extension\SimpleSAMLphp\UserInfoProvider\GenericCallback( function( $attributes ) {
if ( !isset( $attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'] ) ) {
throw new Exception( 'missing email address' );
}
$parts = explode( '@', $attributes['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'][0]);
return strtolower( $parts[0] );
} );
}
];
$wgPluggableAuth_Config['Log in using my SAML'] = [
'plugin' => 'SimpleSAMLphp',
'data' => [
'authSourceId' => 'default-sp',
'usernameAttribute' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress',
'realNameAttribute' => ['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname','http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname'],
'emailAttribute' => 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress',
'userinfoProviders' => [
'username' => 'myusername'
]
]
];
From Logs:
> Authentication.log <
2023-11-20 11:48:34 hostname wiki: Primary login with MediaWiki\Extension\PluggableAuth\PrimaryAuthenticationProvider returned REDIRECT
> PluggableAuth.log <
2023-11-20 11:48:34 hostname wiki: In execute() 2023-11-20 11:48:34 hostname wiki: Getting PluggableAuth instance 2023-11-20 11:48:34 hostname wiki: Plugin name: SimpleSAMLphp
> simplesamlphp.log <
Nov 20 11:48:34 simplesamlphp ERROR [TR72440098] Error loading session: Invalid session ID
> PluggableAuth.log <
2023-11-20 11:48:34 hostname wiki: Invalid authentication plugin class: Invalid session ID
> Authentication.log <
2023-11-20 11:48:35 hostname wiki: Login failed in primary authentication by MediaWiki\Extension\PluggableAuth\PrimaryAuthenticationProvider
Not sure whats gone wrong. can someone suggest?
--
GT