如何保护 Apache CXF RESTful API 的安全?

发布于 2024-09-06 05:07:17 字数 161 浏览 2 评论 0原文

有没有一种简单的方法来保护通过 Apache CXF 的 JAX-RS 实现公开的 RESTful API?是否有通过 Spring Security 实现安全性的钩子?

我听说有人通过 HTTPS 使用基本身份验证,但我还没有看到任何实际的示例。任何想法将不胜感激。

谢谢!

Is there an easy way to secure RESTful API exposed via Apache CXF's JAX-RS implementation? Are there any hooks for security via Spring Security?.

I heard of people using Basic Authentication over HTTPS, but I haven't seen any actual examples. Any ideas would be greatly appreciated.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

墨小沫ゞ 2024-09-13 05:07:17

不了解 CXF,但在 Resteasy 中,您可以像配置任何其他 Web 应用程序一样配置它,然后执行...

@Context private SecurityContext sc;

这允许您检查诸如 sc.isUserInRole("admin");sc.isUserInRole("admin");. CXF可以提供相同的功能。

Don't know about CXF, but in Resteasy you can configure it as you would for any other web application, and then do..

@Context private SecurityContext sc;

Which allows you to check things such as sc.isUserInRole("admin");. CXF may provide the same functionality.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文