禅道
Zentao is an agile project management tool. It does not support OIDC natively; use the zentao-oidc module to integrate Casdoor SSO.
步骤1:部署Casdoor和Zentao
Deploy Casdoor and Zentao. Ensure both are running and you can sign in to each.
步骤2:集成Zentao OIDC第三方模块
通过运行以下命令安装 zentao-oidc:
git clone https://github.com/casdoor/zentao-oidc.git
Alternatively, download the ZIP and unzip it.
此模块用于将Zentao与OpenId的SSO进行集成。 以下是如何使用它:
-
将整个
oidc目录复制到Zentao的模块中,并将其作为Zentao的一个模块使用。 将下载的包重命名为“oidc”。 -
配置过滤器。
Since the Zentao framework filters the parameters in the URL and does not allow spaces, add the following at the end of
/config/my.php.$filter->oidc = new stdclass();
$filter->oidc->index = new stdclass();
$filter->oidc->index->paramValue['scope'] = 'reg::any'; -
修改
/module/commom/model.php。将 'oidc' 添加到匿名访问列表中,并在
model.php的isOpenMethod方法中添加一行。public function isOpenMethod($module, $method)
{
if ($module == 'oidc' and $method == 'index') {
return true;
}
} -
如果你不希望看到Zentao的登录界面,可以直接前往Casdoor的登录界面。
修改
/module/common/model.php中的public function checkPriv()的最后一行代码。//返回 print(js::locate(helper::createLink('user', 'login', "referer=$referer")));
返回 print(js::locate(helper::createLink('oidc', 'index', "referer=$referer"))); -
修改
framework/base/router.class.php中的setSuperVars()方法,并注释掉以下语句。public function setSuperVars()
// unset($_REQUEST);
步骤3:配置Casdoor应用程序
- 创建一个新的Casdoor应用程序,或使用一个已经存在的。
- 添加您的重定向URL。

- 添加您想要的提供商并填写其他所需设置。
步骤4:配置Zentao
在oidc目录中配置config.php文件。
$config->oidc->clientId = "<您的ClientId>";
$config->oidc->clientSecret = "<您的ClientSecret>";
$config->oidc->issuer = "http://localhost:8000";
在module/oidc中设置你的重定向URL,在public function index()方法中。
$oidc->setRedirectURL($path."/zentao/oidc-index.html");
这里的URL是指调用 'index' 方法在 'oidc ' 模块中。 您还需要设置一个变量分隔符。 默认情况下,框架使用破折号("-")。 See the official Zentao framework docs for more details. "zentaoPHP框架"