I am trying to do a simple username and password authentication in a Spring Security web application. I have a web service that authenticates by passing username / password and returns the role. Then I need to save the password for future web service calls.
My application was originally created using the Fuse application, so it had JDBC based authentication. I tore this up, but I'm not sure how to add my own authentication.
The documentation says that "simple" is added to such a mechanism . But the sample application is a hello-world command-line program, not a web application. I cannot find an example of username and password authentication in a web application.
My XML file has the following:
<beans:bean id="myProvider" class="com.example.MyProvider"></beans:bean> <authentication-manager> <authentication-provider ref="myProvider"></authentication-provider> </authentication-manager>
I do not know if this place is suitable for entering my authentication, and I am not sure which interface to implement. I think I might need to implement AuthenticationManager . And I could use a UsernamePasswordAuthenticationToken .
How to connect it all together?
source share