【问题标题】:Integrating Keycloak with Alfresco将 Keycloak 与 Alfresco 集成
【发布时间】:2020-02-20 18:32:18
【问题描述】:

我在我的 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 INFO --- [restartedMain] a.i.IdentityServiceDeploymentFactoryBean:Keycloak 领域:alfresco-dbp 2019-10-24 16:41:34.956 INFO --- [restartedMain] a.i.IdentityServiceDeploymentFactoryBean:Keycloak 客户端 ID:alfresco-client 2019-10-24 16:41:34.958 INFO --- [restartedMain] o.a.r.m.s.ChildApplicationContextFactory:“身份验证”子系统的启动,ID:[身份验证,托管,身份服务 1] 完成

【问题讨论】:

  • 你配置KeyCloak作为Authentication子系统了吗?可以分享您的配置详细信息吗?
  • authentication.chain=identity-service1:identity-service,alfrescoNtlm1:alfrescoNtlm identity-service.authentication.enabled=true identity-service.enable-basic-auth=true identity-service.authentication.defaultAdministratorUserNames =admin identity-service.authentication.validation.failure.silent=false identity-service.auth-server-url=localhost:8011/auth identity-service.realm=alfresco-dbp identity-service.resource=alfresco-client 身份服务。 public-client=true identity-service.ssl-required=none
  • 使用相同的配置,我可以在 alfresco-community-6.1 中运行。在 Spring Boot 中,我使用具有相同配置的 alfresco-repository 版本 7.9,但它不起作用

标签: alfresco keycloak


【解决方案1】:

Alfresco 为 SSO 提供身份服务。我已将 Alfresco 6.2.2 与 Identity Service 1.3 集成。它工作正常。 但是,如果您想独立实现独立的 keycloak,它将使用相同的配置。我已经使用 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 Digital Workspace),那么 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"
  },

【讨论】:

    猜你喜欢
    • 2021-01-10
    • 1970-01-01
    • 1970-01-01
    • 2018-10-23
    • 2022-07-11
    • 1970-01-01
    • 2022-07-07
    • 1970-01-01
    • 2022-11-17
    相关资源
    最近更新 更多