【问题标题】:icCube - How to do Authentication for icCube using an Apache web servericCube - 如何使用 Apache Web 服务器对 icCube 进行身份验证
【发布时间】:2023-03-21 16:46:01
【问题描述】:

我目前正在编写一个 WebApp 来访问我们 ICCube 系统中的报告。应用程序页面托管在与 IcCube 服务器不同的服务器上。该服务器当前是本地 Apache 服务器 (xampp),使用 Basic Auth 在用户访问我的 htdocs 之前对其进行身份验证。我希望我的 Apache 在 icCube 的内部授权管理报告访问时进行身份验证,只需要一次登录。

我的申请是基于IcCube提供的live demo for web reporting;因此它使用显式 JavaScript 身份验证(它通过 ic3.getDemoDataSourceSettings() 获取演示用户数据)。

在尝试通过IcCube documentation 处理此事后,我和以前一样困惑。 Apache 配置的相关页面列出了 Apache 和 icCube 的可能配置,但我不明白我应该使用哪个(优点和缺点),以及它们是否都适用于我们的服务器设置。

  1. Apache 配置概述: 如果我在我的服务器配置中设置这些代理参数,究竟是什么 转发到 IcCube?
  2. icCube 身份验证 Servlet 过滤器: 此配置提取属于 IcCube 还是 Apache?这些过滤器到底在做什么?

任何有关该问题的帮助或指向更深入文档的指针将不胜感激。

【问题讨论】:

    标签: authentication xampp iccube iccube-reporting


    【解决方案1】:

    您的 Web 应用程序(即 Apache)必须转发与访问 icCube 中的报告相关的调用。例如,您可以将 Apache 配置为转发与 icCube 相关的所有内容,如下所示:

    <VirtualHost *:80>
    ServerName your.domain.com
    
    ProxyRequests Off
    
    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>
    
    ProxyPass        /icCube http://your-ip:8383/icCube
    ProxyPassReverse /icCube http://your-ip:8383/icCube
    
    </VirtualHost>
    

    然后使用 icCube 配置 (icCube.xml) 中的 Servlet 过滤器保护 Apache 和 icCube 之间的通信:

    IcCubeApacheAuthenticationServletFilter
    IcCubeApacheGwtAuthenticationServletFilter
    

    第一个过滤器可用于除 GWT 之外的所有服务;对于 GWT,您可以使用第二个。这是一个可能的 icCube.xml 的摘录:

    <xmlaComponentConfiguration>
        <!--<tcpPortNumber>8484</tcpPortNumber>-->
        <httpUrl>/icCube/xmla</httpUrl>
        <enableHttpCompression>true</enableHttpCompression>
        <filter>XMLA (Apache) Authentication</filter>
    </xmlaComponentConfiguration>
    
    <gwtServiceComponentConfiguration>
        <enableFileDownloadCompression>true</enableFileDownloadCompression>
        <filter>GWT (Apache) Authentication</filter>
    </gwtServiceComponentConfiguration>
    
    <reportingComponentConfiguration>
        <url>/icCube/doc/*</url>
        <enableCompression>true</enableCompression>
        <filter>Report Authentication</filter>
    </reportingComponentConfiguration>
    
    <gviComponentConfiguration>
        <url>/icCube/gvi</url>
        <enableCompression>true</enableCompression>
        <filter>GVI Authentication</filter>
        <filter>GVI Authentication (logout)</filter>
    </gviComponentConfiguration>
    
    <filterConfiguration>
        <filter>
            <filter-name>XMLA (Apache) Authentication</filter-name>
            <filter-class>crazydev.iccube.server.authentication.IcCubeApacheAuthenticationServletFilter</filter-class>
        </filter>
        <filter>
            <filter-name>GWT (Apache) Authentication</filter-name>
            <filter-class>crazydev.iccube.server.authentication.IcCubeApacheGwtAuthenticationServletFilter</filter-class>
        </filter>
        <filter>
            <filter-name>Report Authentication</filter-name>
            <filter-class>crazydev.iccube.server.authentication.IcCubeApacheAuthenticationServletFilter</filter-class>
        </filter>
        <filter>
            <filter-name>GVI Authentication</filter-name>
            <filter-class>crazydev.iccube.server.authentication.IcCubeApacheAuthenticationServletFilter</filter-class>
            <init-param>
                <param-name>anonymousLogon</param-name>
                <param-value>false</param-value>
            </init-param>
        </filter>
        <filter>
            <filter-name>GVI Authentication (logout)</filter-name>
            <filter-class>crazydev.iccube.server.authentication.IcCubeGviLogoutAuthenticationServletFilter</filter-class>
        </filter>
    </filterConfiguration>
    

    希望对您有所帮助。

    【讨论】:

    • 我目前将我的用户数据显式传递给 ic3.Reporting,如下所示:var dsSettings = ic3.getDemoDataSourceSettings(); dsSettings.url = gviUrl; var ic3reporting = new ic3.Reporting( { noticesLevel: ic3.NoticeLevel.ERROR, dsSettings: dsSettings} 如何更改此段落以使用 servlet 解决方案?我假设我仍然需要一段类似的代码来让 getAllReportNames() 获得用户有权访问的内容。
    • 不确定为什么需要显式登录。阿帕奇基本身份验证。执行意味着您的 Javascript 文件发送的 GVI 请求将在服务器端进行身份验证,这意味着返回的报告列表取决于经过身份验证的用户。
    • 这是否意味着我可以将 dsSettings 保留为未定义?
    • 好的,我配置了 IcCube 和 Apache 的本地测试安装,类似于您的示例,它似乎可以工作。由于不同的问题,我无法正确测试它,我将在单独的问题中发布。感谢您迄今为止的帮助!
    • 更新:使用我们的实时系统测试配置后,icCube 不再可访问,无论是通过标准在线界面还是通过 apache 托管的 WebApp。界面状态:HTTP ERROR: 500 Problem accessing /icCube/service.gwt. Reason: javax.servlet.ServletException: icCube authentication [icCube-icc-users] error : missing user credentials 我认为我们当前系统中的配置存在根本问题,有什么想法吗?我现在回滚到早期的 iccube.xml。
    猜你喜欢
    • 2011-04-22
    • 1970-01-01
    • 2012-07-28
    • 1970-01-01
    • 1970-01-01
    • 2014-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多