gpt4 book ai didi

java - Apache CXF : How to secure JAX-RS web service with basic authentication

转载 作者:IT老高 更新时间:2023-10-28 13:50:10 25 4
gpt4 key购买 nike

我有一个 Spring 应用程序,它使用 Apache CXF(使用 jax-rs)发布一些 RESTful Web 服务。我想使用 HTTP 基本身份验证来保护对这些服务的访问。用户名和密码应该在 Spring 配置文件中。主应用程序已经使用了 Spring Security,我不想弄乱那个设置。

最简单的方法是什么?我可以编写自己的 ServletFilter,但肯定有办法配置它吗?

最佳答案

HTTP Basic Authentication with Apache CXF Revisited 的作者提供了实现 HTTP 基本身份验证验证的 CXF 拦截器的代码,以及如何定义安全拦截器并在简单端点上启用它的示例。

关于java - Apache CXF : How to secure JAX-RS web service with basic authentication,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1497297/

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