将Keycloak与Alfresco集成

时间:2019-10-24 12:03:08

标签: alfresco keycloak

我在我的Spring Boot应用程序中使用Alfresco。我想使用身份验证子系统(身份服务)。我已经在alfresco-global.properties中给出了要使用的配置。 它没有连接到Keycloak。在日志中找不到错误。我可以在日志中找到身份验证子系统启动。

[restartedMain] a.i.IdentityServiceDeploymentFactoryBean:Keycloak JWKS URL:http://localhost:8011/auth/realms/alfresco-dbp/protocol/openid-connect/certs 2019-10-24 16:41:34.956信息--[restartMain] a.i.IdentityServiceDeploymentFactoryBean:Keycloak领域:alfresco-dbp 2019-10-24 16:41:34.956信息--[restartedMain] a.i.IdentityServiceDeploymentFactoryBean:Keycloak客户端ID:alfresco-client 2019-10-24 16:41:34.958信息--[restartedMain] o.a.r.m.s.ChildApplicationContextFactory:'Authentication'子系统的启动,ID:[Authentication,managed,identity-service1]完成

1 个答案:

答案 0 :(得分:0)

Alfresco为SSO提供身份服务。我已经将Alfresco 6.2.2与Identity Service 1.3集成在一起。一切正常。 但是,即使您想独立实现独立的密钥库,也可以使用相同的配置。我已经使用keycloak 9.0.3和keycloak 11.0.0(这是Identity Service 1.3的基础版本)进行了测试-两者都与Alfresco集成在一起,并且可以正常工作。

露天文件中的配置将保持不变: 以下是alfresco-global.properties设置。假定Keycloak正在端口8081上运行:

authentication.chain=identity-service-1:identity-service,alfrescoNtlm-1:alfrescoNtlm
identity-service.auth-server-url=http://localhost:8081/auth
identity-service.enable-basic-auth=true
identity-service.realm=sharerealm
identity-service.resource=alfresco
csrf.filter.referer=http://localhost:8080
csrf.filter.origin=http://localhost:8080/*

aims.enabled=true
aims.realm=sharerealm
aims.resource=alfresco
aims.authServerUrl=http://localhost:8081/auth
aims.publicClient=true

share-config-custom.xml文件中的条目:

<!-- AIMS -->
   
<config evaluator="string-compare" condition="AIMS">
<enabled>true</enabled>
<realm>sharerealm</realm>
<resource>alfresco</resource>
<authServerUrl>http://localhost:8081/auth</authServerUrl>
<sslRequired>none</sslRequired>
<publicClient>true</publicClient>
<autodetectBearerOnly>true</autodetectBearerOnly>
<alwaysRefreshToken>true</alwaysRefreshToken>
<principalAttribute>email</principalAttribute>
<enableBasicAuth>true</enableBasicAuth>
</config>

如果您正在使用ADF或ADW(Alfresco数字工作区),则app.config.json中的以下条目:

"$schema": "../node_modules/@alfresco/adf-core/app.config.schema.json",
  "ecmHost": "http://localhost:8080",
  "aosHost": "http://localhost:8080/alfresco/aos",
  "baseShareUrl": "http://localhost:8080/adw",
  "providers": "ECM",
  "authType": "OAUTH",
  "oauth2": {
    "host": "http://localhost:8081/auth/realms/sharerealm",
    "clientId": "alfresco",
    "scope": "openid",
    "secret": "",
    "implicitFlow": true,
    "silentLogin": true,
    "publicUrls": [
      "**/preview/s/*",
      "**/settings"
    ],
    "redirectSilentIframeUri": "http://localhost:8080/adw/assets/silent-refresh.html",
    "redirectUri": "/adw",
    "redirectUriLogout": "/adw/#/login"
  },