{% hint style="success" %} 对应的官方页面地址 {% endhint %}
Vaultwarden 的 SSO 支持目前正在开发中。以下内容描述了基于 docker-compose 的用于本地测试这些更改的设置。
{% hint style="danger" %} 仅用于测试 SSO,这些设置并不安全! {% endhint %}
-
查看 SSO 分支
-
使用以下内容创建
docker-compose.yml
:services: vaultwarden: build: . environment: DOMAIN: "http://localhost:8000" I_REALLY_WANT_VOLATILE_STORAGE: "true" SSO_ENABLED: "true" SSO_CLIENT_ID: "client" SSO_CLIENT_SECRET: "clientsecret" SSO_AUTHORITY: "http://auth.test:8080/mock" ports: - 127.0.0.1:8000:80 mock-oauth2: image: ghcr.io/navikt/mock-oauth2-server:0.5.10 hostname: "auth.test" ports: - 127.0.0.1:8080:8080
-
将
auth.test
添加到您的系统 host 文件中:echo "127.0.0.1 auth.test" | sudo tee -a /etc/hosts
-
构建 Vaultwarden:
docker compose build
- 启动服务:
docker compose up
- 转到 http://localhost:8000/#/sso,输入任意字符串作为标识符,点击「登录」
- 在模拟 Auth2 服务器登录页面上,输入任意字符串作为用户/主题,并在声明字段中添加要测试的电子邮件,像这样:
{"email": "user@example.com"}
- 如果一切按计划进行,您将会被要求输入主密码