# 启用 Syncope 登录模块

可用产品...

* Data Fabric
* Data Services Platform
* ESB
* MDM Platform
* Real-Time Big Data Platform

基于 Apache Syncope 的 Talend Identity and Access Management 系统允许您跨所有 Talend Web 应用程序管理用户访问权限。对于 Talend ESB，它用于管理 ESB 运行时环境中的用户和组。因此 Talend Identity and Access Management 是对 Talend ESB 使用身份验证和授权所必需的。有关如何安装和配置 Talend Identity and Access Management 的更多信息，请参阅[I安装和配置 Talend Identity and Access Management](https://help.qlik.com/talend/en-US/installation-guide-linux/7.3/install-iam)。

安装 Talend Identity and Access Management 以后，您可以通过将 Syncope 蓝图 XML 文件部署到 &lt;TalendESBPath&gt;/container/deploy 文件夹，从而在 Talend ESB中启用 Syncope 登录模块。

蓝图描述符的模板如下所示：

```
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:jaas="http://karaf.apache.org/xmlns/jaas/v1.1.0"
           xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">

    <jaas:config name="karaf" rank="2">
        <jaas:module className="org.apache.karaf.jaas.modules.syncope.SyncopeLoginModule"
                     flags="required">
           address=http://localhost:9080/syncope/rest
           admin.user=admin
           admin.password=password
           version=2
        </jaas:module>
    </jaas:config>

    <service interface="org.apache.karaf.jaas.modules.BackingEngineFactory">
        <bean class="org.apache.karaf.jaas.modules.syncope.SyncopeBackingEngineFactory"/>
    </service>

</blueprint>
```

address 属性需配置为引用您的 Syncope 服务器。对于 Syncope 2.x，它必须设置为 ..syncope/rest 而不是针对 Syncope 1.x 的 ..syncope/cxf。

还应该配置用于访问 Syncope 的凭据。

version 属性用于选择 Syncope 后端版本 1 或 2。

要检查 Syncope 登录模块是否成功安装：

## 步骤

1. 获取可用 Jaas 领域的列表。
   ```
   karaf@trun> jaas:realm-list
   Index | Realm Name | Login Module Class Name
   ------+------------+---------------------------------------------------------
   1     | karaf      | org.apache.karaf.jaas.modules.syncope.SyncopeLoginModule
   ```
2. 使用前一步获得的 Jaas 领域索引选择 Jaas 领域。
   ```
   karaf@trun> jaas:realm-manage --index 1
   ```
3. 检查 Syncope 用户列表。
   ```
   karaf@trun()> jaas:user-list
   ```