Simplesamlphp
安装:
cd /opt/www/html
tar xzf simplesamlphp-x.y.z.tar.gz
mv simplesamlphp-x.y.z samlldp
设置Apache设置:
Alias /samlsp /opt/www/html/samlsp/www
Alias /samlldp /opt/www/html/samlldp/www
<Directory /opt/www/html/samlsp/www>
Require all granted
</Directory>
<Directory /opt/www/html/samlldp/www>
Require all granted
</Directory>
Simplesamlphp可以设置为LDP, 也可以设置为SP;
可以在服务器上建立两个独立的解压目录, 如上图。本文主要是配置基于Mysql数据存储的LDP;
Simplesamlphp的配置目录位于:/opt/www/html/samlldp/config
其中:
config.php为Simplesamlphp本身的设置
authsources.php 为授权源设置
'baseurlpath' => 'samlldp/',
'technicalcontact_name' => 'xxx',
'technicalcontact_email' => 'xxx@qq.com',
'timezone' => 'Asia/Shanghai',
'secretsalt' => 'absssssssssst',
'auth.adminpassword' => 'xxxxx',
'debug' => [
'saml' => true,
'backtraces' => true,
'validatexml' => false,
],
/*
* Database connection string.
* Ensure that you have the required PDO database driver installed
* for your connection string.
*/
'database.dsn' => 'mysql:host=xx.x.x.x;dbname=samlldp',
/*
* SQL database credentials
*/
'database.username' => 'xxx',
'database.password' => 'xxxxxxx',
'database.options' => [],
'module.enable' => [
'exampleauth' => false,
'core' => true,
'saml' => true
],
'store.type' => 'sql',
'store.sql.dsn' => 'mysql:host=xx.x.xx.xx;dbname=samlldp',
/*
* The username and password to use when connecting to the database.
*/
'store.sql.username' => 'xxx',#null,
'store.sql.password' => 'xx',# null,
authsources.php 设置
'example-sql' => [
'sqlauth:SQL',
'dsn' => 'mysql:host=xxx.xx.x.x;port=3306;dbname=samlldp',
'username' => 'xx',
'password' => 'xxx',
'query' => 'SELECT uid, givenName, email, eduPersonPrincipalName FROM users WHERE uid =:username AND password = SHA2(CONCAT((SELECT salt FROM users WHERE uid = :username),:password), 256);',
],