
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
https://img.shields.io/docker/v/kenchan0130/simplesamlphp?sort=semver](https://hub.docker.com/r/kenchan0130/simplesamlphp) https://github.com/kenchan0130/docker-simplesamlphp/workflows/CI/badge.svg](https://github.com/kenchan0130/docker-simplesamlphp/actions?query=workflow%3ACI) https://img.shields.io/badge/License-MIT-yellow.svg](https://github.com/kenchan0130/docker-simplesamlphp/blob/master/LICENSE)
用于开发和测试的即插即用型SAML 2.0身份提供商(IdP) Docker容器。
基于SimpleSAMLphp构建,以https://hub.docker.com/_/php/%E4%B8%BA%E5%9F%BA%E7%A1%80%E3%80%82
SimpleSAMLphp以调试日志级别将日志输出到stdout,Apache将错误日志和访问日志输出到stdout。
禁止在生产环境中使用。此镜像仅用于测试。
shdocker run --name=idp \ -p 8080:8080 \ -e SIMPLESAMLPHP_SP_ENTITY_ID=http://app.example.com \ -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: http://app.example.com 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时很有用。如果设置此变量,请以斜杠/结尾,例如:https://my.proxy.com/。默认值为空字符串。 |
如需自定义IdP用户,可通过挂载配置文件定义自己的用户。
php<?php // 这些属性模拟Azure AD的属性 $test_user_base = array( 'http://schemas.microsoft.com/identity/claims/tenantid' => 'ab4f07dc-b661-48a3-a173-d0103d6981b2', 'http://schemas.microsoft.com/identity/claims/objectidentifier' => '', 'http://schemas.microsoft.com/identity/claims/displayname' => '', 'http://schemas.microsoft.com/ws/2008/06/identity/claims/groups' => array(), 'http://schemas.microsoft.com/identity/claims/identityprovider' => 'https://sts.windows.net/da2a1472-abd3-47c9-95a4-4a0068312122/', 'http://schemas.microsoft.com/claims/authnmethodsreferences' => array('http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/password', 'http://schemas.microsoft.com/claims/multipleauthn'), 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress' => '', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname' => '', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname' => '', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name' => '' ); $config = array( 'admin' => array( 'core:AdminPassword', ), 'example-userpass' => array( 'exampleauth:UserPass', 'user1:password' => array_merge($test_user_base, array( 'http://schemas.microsoft.com/identity/claims/objectidentifier' => 'f2d75402-e1ae-40fe-8cc9-98ca1ab9cd5e', 'http://schemas.microsoft.com/identity/claims/displayname' => 'User1 Taro', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress' => 'user1@example.com', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname' => 'Taro', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname' => 'User1', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name' => 'user1@example.com' )), 'user2:password' => array_merge($test_user_base, array( 'http://schemas.microsoft.com/identity/claims/objectidentifier' => 'f2a94916-2fcb-4b68-9eb1-5436309006a3', 'http://schemas.microsoft.com/identity/claims/displayname' => 'User2 Taro', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress' => 'user2@example.com', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname' => 'Taro', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname' => 'User2', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name' => 'user2@example.com' )), ), );
将此代码保存为authsources.php后,可通过卷挂载自定义IdP用户:
docker run命令
shdocker run --name=idp \ -p 8080:8080 \ -e SIMPLESAMLPHP_SP_ENTITY_ID=http://app.example.com \ -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: http://app.example.com 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
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务