gpt4 book ai didi

java - 如何将 CAS 身份验证与 Apache wicket 应用程序集成?

转载 作者:行者123 更新时间:2023-12-01 14:34:54 25 4
gpt4 key购买 nike

我正在开发一个项目,必须将 CAS 身份验证集成到 Apache Wicket 应用程序中。虽然我仍然是 Web 开发的初学者,但我知道如何在简单的 Web 应用程序中实现 CAS 身份验证(使用 Spring-security),其中我定义了一个目录/文件,用户可以访问它们之前需要身份验证。以下是我创建并测试的 CAS 应用程序结构示例。在下面的示例中,访问“安全”目录中的文件需要身份验证。

My existing CAS appication

applicationContext-security.xml的内容如下。

    <security:http entry-point-ref="casAuthenticationEntryPoint" auto-config="true">
<security:intercept-url pattern="/secure/**" access="ROLE_AUTHENTICATED"></security:intercept-url>
<security:custom-filter position="CAS_FILTER" ref="casAuthenticationFilter"></security:custom-filter>
</security:http>

但是如果我必须保护 apache wicket 应用程序中的文件,我该怎么做?我想通过显示“edu.vt.geoserver.HomePage.html”而不进行身份验证来启动我的应用程序,并设置身份验证要求来访问“edu.vt.geoserver.securePages”中的文件。请参阅我的目标应用程序的附件结构。

Target wicket application where I would like CAS authentication

如果有人可以在这方面帮助我,请告诉我。我已经看到 Jasig 的非官方 cas 客户端用于 Wicket 口申请,但仍然不确定我需要做哪些更改。非常感谢在这方面的任何帮助。

谢谢

萨钦

最佳答案

如果其他一切都设置正确,您可能只需将安全页面安装到 Application 类的 init 方法中的正确 URL,如下所示:

mountPage("/secure/GeoServerFrontPage", edu.vt.geoserver.securePages.GeoServerFrontPage.class);

由于您的 Spring Security 配置为保护 URL 模式“/secure/**”中的所有页面,因此调用您的 GeoServerFrontPage 应该会触发登录。

您还可以查看 mountPackage() 方法,只需一行代码即可挂载 securePages-Package 中的所有页面...。

问候,汤姆

关于java - 如何将 CAS 身份验证与 Apache wicket 应用程序集成?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16574305/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com