我想在Spring安全网络应用程序中进行简单的用户名/密码验证。我有一个通过传入用户名/密码进行身份验证的Web服务,并取回角色。然后,我需要保留密码以便将来的Web服务调用。春季安全用户名密码验证
我的应用程序最初是使用App Fuse创建的,因此它具有一些基于JDBC的身份验证。我已经撕掉了,但我不知道如何添加我的自定义身份验证。
该文档说明它是"simple" to add in such a mechanism。但示例应用程序是一个命令行hello世界风格的程序,而不是一个Web应用程序。我似乎无法在Web应用程序中找到用户名/密码身份验证的示例。
我有我的XML文件中的以下内容:
<beans:bean id="myProvider" class="com.example.MyProvider"></beans:bean>
<authentication-manager>
<authentication-provider ref="myProvider"></authentication-provider>
</authentication-manager>
我不知道这是否是把我的身份验证在正确的地方,我不知道要实现什么样的接口。我想我可能需要执行AuthenticationManager
。我可能会使用UsernamePasswordAuthenticationToken
。
如何连接这一切?
在[detail here]中包含了SpringSecurity的一些内容(http://techastute.blogspot.com/2013/01/spring-security-in-detail.html),可能对它有用有一个。 – raksja 2013-01-21 17:49:28