Zentao
Using Hanzo IAM for authentication in Zentao
Zentao is an agile project management tool. It does not support OIDC natively; use the zentao-oidc module to integrate Hanzo IAM SSO.
Step 1: Deploy Hanzo IAM and Zentao
Step 2: Integrate Zentao OIDC third-party module
Install zentao-oidc by running the following command:
git clone https://github.com/iam/zentao-oidc.git
Alternatively, download the ZIP and unzip it.
This module is used to integrate Zentao with SSO for OpenId. Here's how to use it:
1. Copy the entire `oidc` directory to the module of Zentao and use it as a module of Zentao.
Rename the downloaded package to "oidc".
2. Configure the filter.
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`.
```php
$filter->oidc = new stdclass();
$filter->oidc->index = new stdclass();
$filter->oidc->index->paramValue['scope'] = 'reg::any';- Modify
/module/commom/model.php. Add 'oidc' to the anonymous access list and add a line to theisOpenMethodmethod ofmodel.php.public function isOpenMethod($module, $method) { if ($module == 'oidc' and $method == 'index') { return true; } } - If you don't want the Zentao login screen to appear, go directly to the Hanzo IAM login screen.
Modify the last line of code in
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 the
setSuperVars()method insideframework/base/router.class.phpand comment out the following statements.public function setSuperVars() // unset($_REQUEST);
Step 3: Configure Hanzo IAM Application
- Create a new Hanzo IAM application or use an existing one.
- Add your redirect URL.

- Add the provider you want and fill in other required settings.
Step 4: Configure Zentao
Configure the config.php file in the oidc directory.
$config->oidc->clientId = "<Your ClientId>";
$config->oidc->clientSecret = "<Your ClientSecret>";
$config->oidc->issuer = "http://localhost:8000";
Set your redirect URL in `module/oidc` in the `public function index()` method.
```php
$oidc->setRedirectURL($path."/zentao/oidc-index.html");
:::note
The URL here refers to calling the 'index' method in the 'oidc' module. You also need to set a variable separator.
By default, the framework uses a dash ("-").
See the official Zentao framework docs for more details.
["zentaoPHP框架"](https://devel.easycorp.cn/book/zentaophphelp/about-10.html)
:::How is this guide?
Last updated on