What is the best (and easay) way to restrict (JAX-RS Jersey) RESTFul APIs from being accessed by third party?
(I want these APIs to be used by my application only)
What is the best (and easay) way to restrict (JAX-RS Jersey) RESTFul APIs from being accessed by third party?
(I want these APIs to be used by my application only)
有几个。为了简单起见,它们是:
这取决于你有什么样的额外要求。但是从您的简要描述来看,我认为简单的防火墙是您情况下的最佳解决方案。
对于应用程序级别,您可以尝试Spring Security http://www.springsource.org/spring-security并在 URL 级别进行限制,或者如果您想要更简单一些,您可以通过使用Servlet规范 API 通过放置web.xml来实现,请记住宁静的 Web 服务生命周期的工作方式与 servlet 相同。