Zentao
Zentao is an agile(scrum) project management system/tool, but it does not support OIDC itself. For integrating Zentao with Casdoor SSO, we should via 3rd-party OIDC module zentao-oidc, and this document will show you how to do it.
Step1. Deploy Casdoor and Zentao
Firstly, the Casdoor and Zentao should be deployed. After a successful deployment, you need to ensure:
- Casdoor can be logged in and used successfully.
- You can successfully log in and use Zentao
Step2. Integrated Zentao OIDC third party module
install zentao-oidc
git clone https://github.com/casdoor/zentao-oidc.git
or you can download the ZIP and unzip it.
This module is used for Zentao integrating with SSO for OpenId. The usage is as follows:
Copy the entire oidc directory to the Module of The Zentao and use it as a module of the Zentao. Rename the downloaded package to "oidc"
Configure the filter
Because the framework of Zentao filters the parameters in URL and does not allow Spaces. So you need to put the following code at the end of
/config/my.php
.$filter->oidc=new stdclass();
$filter->oidc->index=new stdclass();
$filter->oidc->index->paramValue['scope']='reg::any';Modify
/module/commom/model.php
Put 'oidc' on the anonymous access list and add a line to the
isOpenMethod
method ofmodel.php
.
public function isOpenMethod($module, $method){
if($module == 'oidc' and $method == 'index') return true;
}
- If you do not want the Zentao login screen to appear, go directly to the Casdoor login screen.
Modify the last line of code at
public function checkPriv()
in/module/common/model.php
.
//return print(js::locate(helper::createLink('user', 'login', "referer=$referer")));
return print(js::locate(helper::createLink('oidc', 'index', "referer=$referer")));
- Modify
setSuperVars()
method inside offramework/base/router.class.php
, comment out the following statements.
public function setSuperVars()
// unset($_REQUEST);
Step3. Configure Casdoor Application
- Create or use an existing Casdoor application.
- Add Your redirect url
- Add provider you want and supplement other settings.
Step4. Configure Zentao
Configure config.php
in the oidc
$config->oidc->clientId="<Your ClientId>";
$config->oidc->clientSecret="<Your ClientSecrect>";
$config->oidc->issuer="http://localhost:8000";
set your reditrect Url in module/oidc public function index()
$oidc->setRedirectURL($path."/zentao/oidc-index.html");
The URL here refers to calling the 'index' method in the 'oidc' module. You also need to set a variable separator,
which the framework defaults to with a dash : -
please refer to zentao's official framework for details.
"zentaoPHP框架"