
kenchan0130/simplesamlphp Docker容器。
基于SimpleSAMLphp构建,以官方PHP8 Apache镜像为基础。
SimpleSAMLphp以调试日志级别将日志输出到stdout,Apache将错误日志和访问日志输出到stdout。
禁止在生产环境中使用。此镜像仅用于测试。
shdocker run --name=idp \ -p 8080:8080 \ -e SIMPLESAMLPHP_SP_ENTITY_ID=[***] \ -e SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE=http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/test-sp \ -e SIMPLESAMLPHP_SP_SINGLE_LOGOUT_SERVICE=http://localhost/simplesaml/module.php/saml/sp/saml2-logout.php/test-sp \ -d kenchan0130/simplesamlphp
ymlversion: "3" services: idp: image: kenchan0130/simplesamlphp container_name: idp ports: - "8080:8080" environment: SIMPLESAMLPHP_SP_ENTITY_ID: [***] SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE: http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/test-sp SIMPLESAMLPHP_SP_SINGLE_LOGOUT_SERVICE: http://localhost/simplesaml/module.php/saml/sp/saml2-logout.php/test-sp
IdP中配置了两个静态用户,信息如下:
| 用户名 | 密码 |
|---|---|
| user1 | password |
| user2 | password |
还有一个管理员用户:
| 用户名 | 密码 |
|---|---|
| admin | secret |
| 名称 | 必填/可选 | 描述 |
|---|---|---|
SIMPLESAMLPHP_SP_ENTITY_ID | 必填 | 服务提供者(SP)的实体ID。 |
SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE | 必填 | SP的断言消费者服务URL。 |
SIMPLESAMLPHP_SP_SINGLE_LOGOUT_SERVICE | 可选 | SP的单点登出URL。 |
SIMPLESAMLPHP_IDP_ADMIN_PASSWORD | 可选 | IdP管理员密码。默认值为secret。 |
SIMPLESAMLPHP_IDP_SECRET_SALT | 可选 | IdP生成安全哈希时使用的秘密盐。默认值为defaultsecretsalt。 |
SIMPLESAMLPHP_IDP_SESSION_DURATION_SECONDS | 可选 | IdP会话持续时间(秒)。 |
SIMPLESAMLPHP_IDP_BASE_URL | 可选 | 用于覆盖基础URL。在反向代理后设置https://基础URL时很有用。如果设置此变量,请以斜杠/结尾,例如:[***]。默认值为空字符串。 |
如需自定义IdP用户,可通过挂载配置文件定义自己的用户。
php<?php // 这些属性模拟Azure AD的属性 $test_user_base = array( '[***] => 'ab4f07dc-b661-48a3-a173-d0103d6981b2', '[***] => '', '[***] => '', '[***] => array(), '[***] => '[***] '[***] => array('[***] '[***] '[***] => '', '[***] => '', '[***] => '', '[***] => '' ); $config = array( 'admin' => array( 'core:AdminPassword', ), 'example-userpass' => array( 'exampleauth:UserPass', 'user1:password' => array_merge($test_user_base, array( '[***] => 'f2d75402-e1ae-40fe-8cc9-98ca1ab9cd5e', '[***] => 'User1 Taro', '[***] => '***', '[***] => 'Taro', '[***] => 'User1', '[***] => '***' )), 'user2:password' => array_merge($test_user_base, array( '[***] => 'f2a94916-2fcb-4b68-9eb1-5436309006a3', '[***] => 'User2 Taro', '[***] => '***', '[***] => 'Taro', '[***] => 'User2', '[***] => '***' )), ), );
将此代码保存为authsources.php后,可通过卷挂载自定义IdP用户:
docker run命令
shdocker run --name=idp \ -p 8080:8080 \ -e SIMPLESAMLPHP_SP_ENTITY_ID=[***] \ -e SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE=http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/test-sp \ -e SIMPLESAMLPHP_SP_SINGLE_LOGOUT_SERVICE=http://localhost/simplesaml/module.php/saml/sp/saml2-logout.php/test-sp \ -v $PWD/authsources.php:/var/www/simplesamlphp/config/authsources.php \ -d kenchan0130/simplesamlphp
docker-compose
ymlversion: "3" services: idp: image: kenchan0130/simplesamlphp container_name: idp ports: - "8080:8080" environment: SIMPLESAMLPHP_SP_ENTITY_ID: [***] SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE: http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/test-sp SIMPLESAMLPHP_SP_SINGLE_LOGOUT_SERVICE: http://localhost/simplesaml/module.php/saml/sp/saml2-logout.php/test-sp volumes: - authsources.php:/var/www/simplesamlphp/config/authsources.php
有关详细属性,请参见SimpleSAMLphp身份提供商快速入门#认证模块。
如需自定义SP远程元数据引用,可通过挂载配置文件进行定义。
php<?php /* 数组的索引是此SP的实体ID */ $metadata['entity-id-1'] = array( 'AssertionConsumerService' => 'http://localhost/simplesaml/module.php/saml/sp/saml2-acs.php/test-sp', ForceAuthn => true ); $metadata['entity-id-2'] = array( 'AssertionConsumerService' => 'http://localhost/saml/acs', 'SingleLogoutService' => 'http://localhost/saml/logout' );
将此代码保存为saml20-sp-remote.php后,可通过卷挂载自定义:
docker run命令
shdocker run --name=idp \ -p 8080:8080 \ -v saml20-sp-remote.php:/var/www/simplesamlphp/metadata/saml20-sp-remote.php \ -d kenchan0130/simplesamlphp
docker-compose
ymlversion: "3" services: idp: image: kenchan0130/simplesamlphp container_name: idp ports: - "8080:8080" volumes: - saml20-sp-remote.php:/var/www/simplesamlphp/metadata/saml20-sp-remote.php
有关详细属性,请参见SP远程元数据引用#SAML 2.0选项。
MIT
manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务