【发布时间】:2012-09-17 19:23:27
【问题描述】:
我将jetty 用作与paxweb 的osgi 捆绑包。 我想确保通过 OSGI HttpService 注册的所有 servlet 和资源都由一个通用的 SecurityHandler 保护(此外,我想使用 JAASLoginService)。 我还想将所有未经身份验证的请求重定向到单个登录页面。
是否可以配置这个场景?
【问题讨论】:
标签: jetty osgi security pax-web
我将jetty 用作与paxweb 的osgi 捆绑包。 我想确保通过 OSGI HttpService 注册的所有 servlet 和资源都由一个通用的 SecurityHandler 保护(此外,我想使用 JAASLoginService)。 我还想将所有未经身份验证的请求重定向到单个登录页面。
是否可以配置这个场景?
【问题讨论】:
标签: jetty osgi security pax-web
如果所有 Servlet 都使用相同的 HttpContext,这是可能的。 作为具有工作 Jaas 的运行时容器,我建议使用 Apache Karaf。 它提供了所有需要的东西,包括作为 HTTPService 的 Pax Web,包括 HttpWhiteboard Extender。
【讨论】:
查看 Apache Felix 白板 HTTP 支持。您只需在注册表中注册过滤器,它们就会被底层 Jetty 使用:http://felix.apache.org/site/apache-felix-http-service.html
过滤器支持的过滤器服务属性:
pattern - Regular expression pattern to register filter with.
contextId - Id of context to register with.
service.ranking - Where in the chain this filter should be placed.
init.* - Filter initialization values.
我自己还没有尝试过,但很快就会...
【讨论】: