我有两个小型 http 服务器。一种使用 sun (com.sun.net.httpserver) 服务器,另一种使用嵌入式码头。现在我试图让 HTTP 摘要至少在 jetty 服务器上工作(嗯,这是使用 jetty 而不是 sun httpserver 的原因之一)。无论我使用哪个服务器,基本设置都是通过 spring IOC 容器完成的。
我不喜欢为此目的使用servlet(好吧,使用jetty我得到了HTTPServletRequest和HTTPServletResponse对象)并且我是Spring Security的新手(我只是使用Spring Security,因为它似乎是关于HTTP的最灵活的方法)摘要认证)。我发现的有关 Spring Security 的所有内容都是相当简洁的文档或完全面向 servlet/filter 。
我想知道哪一种是为我的服务器启用 http 摘要的最简单方法。如果 spring security 是答案,如何将 spring 类连接到我的 IOC 容器中。我可以想象处理 http 摘要需要一些手动操作。只要我有一些起始提示,这对我来说就很好。
I have two small http servers. One using the sun (com.sun.net.httpserver) server and one using an embedded jetty. Now I'm trying to get HTTP digest working on at least the jetty server (well, that was one of the reasons to use jetty instead of sun httpserver). Regardless of which server I utilize the basic setup is done via spring IOC container.
I don't like to use servlets for this purpose (well, using jetty I get HTTPServletRequest and HTTPServletResponse objects) and I'm new to spring security (I'm just using spring security because it seemed to be to most flexible approach regarding HTTP digest authentication). All I found about spring security was rather terse documented or completely servlet/filter oriented.
I like to know which is would be the easiest way to enable http digest for my servers. And if spring security is the answer how to wire the spring classes into my IOC container. I can imagine that dealing with http digest needs some manual actions. That is fine for me as long as I have some starting hints.
发布评论
评论(1)
查看 Spring Security 文档。您必须配置 DigestFilter 和 DigestFilterEntryPoint。另外,您还必须提供 用户详细信息服务。一个好的 UserDetailsService 实现应该是 内存中实现。
其余配置应该非常标准。您可以找到一些“入门”这里。
Take a look at the Spring Security Documentation. You will have to configure DigestFilter and DigestFilterEntryPoint. Also, you will have to provide UserDetailsService. A good UserDetailsService implementation to start with would be In-Memory implementation.
Rest of the configuration should be pretty standard. You can find some "Getting Started" here.