【问题标题】:Securing Jersey based REST service using oAuth 2.0使用 oAuth 2.0 保护基于 Jersey 的 REST 服务
【发布时间】:2012-07-19 16:25:51
【问题描述】:

我使用 Jersey 库在 java/netbeans 中创建了 RESTful 服务。现在我想使用 oAuth 2.0 来保护这项服务。

是否有任何库或教程可以实现这一目标?我在 google 中找不到任何有用的东西。

【问题讨论】:

    标签: java web-services rest jersey oauth-2.0


    【解决方案1】:

    您可以使用 Apache Oltu(以前的 Apache Amber):https://cwiki.apache.org/confluence/display/OLTU/Documentation

    授权服务器和资源服务器部分解释了如何保护您的 REST 服务。

    【讨论】:

    • 该链接仅提供 servlet 的代码 sn-ps。他们给了Integration Tests,但链接不起作用。任何基于 Jersey 的服务的完整示例代码?
    【解决方案2】:
    【解决方案3】:

    我们使用了spring security,认为是最简单最简单的方法,查看here了解更多信息:

    【讨论】:

    • 它适用于 jersey 还是仅适用于 spring mvc Web 服务?
    • @shem 你有怎么做的例子吗?
    • 要使用带弹簧的运动衫,请使用ContextLoaderListener
    猜你喜欢
    • 1970-01-01
    • 2012-09-10
    • 2016-08-29
    • 1970-01-01
    • 2017-01-07
    • 2023-03-11
    • 1970-01-01
    • 2015-10-05
    相关资源
    最近更新 更多