如何使用 Jersey 实现 Spring OAuth 安全性?

发布于 2024-12-19 19:18:13 字数 288 浏览 7 评论 0原文

我想在服务器端和客户端的球衣 Restful Web 服务上实现 Spring Security。 目标是当用户想要访问受保护的资源时保证用户授权和身份验证。我尝试了一种解决方案,在服务器端实现 ConsumerDetailsS​​ervice 和 UserDetailsS​​ervice 接口,并在客户端使用 CoreOAuthConsumerSupport(调用 readProtectedResource)。 这是可行的,但问题是它没有利用球衣客户端的优势,例如将数组作为参数传递。

是否有 OAuth 的 Jersey 客户端实现?

I want to implement spring security on a jersey Restful web service, both on server and client side.
The goal is to guarantee user authorization and authentication when he wants to access a protected ressource. I tried a solution by implementing the ConsumerDetailsService and UserDetailsService interfaces on server side and used a CoreOAuthConsumerSupport on client side(calling readProtectedResource).
This works, but the problem is that is doesnot take advantages of the jersey client, for example for passing an array as parameter.

Is there a Jersey client implementation of OAuth?

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

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

发布评论

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

评论(1

最偏执的依靠 2024-12-26 19:18:13

是的,Jersey 在服务器端和客户端都支持 OAuth。请参阅以下 javadoc 页面:

OAuth 服务器< /a>
OAuth 客户端
OAuth 核心类

有Jersey 示例下还有一个使用 OAuth 的 twitter 客户端示例应用程序:http://java.net /projects/jersey/sources/svn/show/trunk/jersey/samples/oauth-client-twitter?rev=5569

Yes, Jersey has support for OAuth on both the server and the client side. See the following javadoc pages:

OAuth Server
OAuth Client
OAuth core classes

There is also a twitter client sample application under Jersey samples that uses OAuth: http://java.net/projects/jersey/sources/svn/show/trunk/jersey/samples/oauth-client-twitter?rev=5569

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