aem - CQ-调度员: How to use allowAuthorized

标签 aem

我知道我可以为授权用户通过

调用的页面激活缓存
/allowAuthorized "1"

/cache 部分。

但是,如果一个页面被缓存,它将被传递给所有调用它的人,甚至是匿名用户。我能否以某种方式检查是否允许用户查看内容?

最佳答案

看看 (1)。

您可以配置定义的/auth_checker 部分

  • url:如果请求有效页面,将通过 HEAD 请求调用的脚本/servlet 的 url。一个页面是有效的,如果它在过滤器部分 /type "allow"
  • filter:定义哪些路径应该被检查,哪些不被检查。
  • headers:在此处配置在 servlet 中设置的附加 header ,这些 header 应该转到前端

这是来自 Adob​​e 在线文档的示例配置:

/auth_checker
  {
  # request is sent to this URL with '?uri=<page>' appended
  /url "/bin/permissioncheck"

  # only the requested pages matching the filter section below are checked,
  # all other pages get delivered unchecked
  /filter
    {
    /0000
      {
      /glob "*"
      /type "deny"
      }
    /0001
      {
      /glob "/content/secure/*.html"
      /type "allow"
      }
    }
  # any header line returned from the auth_checker's HEAD request matching
  # the section below will be returned as well
  /headers
    {
    /0000
      {
      /glob "*"
      /type "deny"
      }
    /0001
      {
      /glob "Set-Cookie:*"
      /type "allow"
      }
    }
  }

页面上还有一个示例 servlet,可用于检查用户在 AEM 中的权限。

(1):https://docs.adobe.com/docs/en/dispatcher/permissions-cache.html

关于aem - CQ-调度员: How to use allowAuthorized,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38534909/

相关文章:

javascript - 已迁移工作流模型和脚本以进行 6.3 到 6.5 AEM 升级,但未拾取脚本

java - "Content-Disposition header"中的配置 "Apache HTTP Server"

java - 如何在后台线程中获取 ResourceResolver?

html - 取消设置 td 填充

aem - 在 CQ5 中获取节点表单 currenPage

html - 禁用自动添加 <p> 标签

aem - 如何从 AEM 中的 Sling POST 生成渲染输出?

java - 如何使 SlingHttpServletRequest.getParts() 在 JUnit Test 中返回正确的值?

java - 从 CQ5 中的 DAM 访问 XML 文件

aem - 通过 sling 重命名用户