spring security 的Basic Authentication

3月 11, 2018 |

对于没有session的客户端, 比如基于httpClient的http Invoker实现,那么就只能使用basic认证了(摘要认证流程一致),基于spring security自带的contact 示例
<http>元素配置如下

spring mvc 的配置如下:

在web.xml中声明:

客户端的spring上下文配置如下:

BasicAuthenticationHttpInvokerRequestExecutor在老的spring security版本中有实现, 现在需要自己实现了。源码如下

Main 方法如下

Posted in: Spring Security

Comments are closed.