8. Conclusion

In this quick tutorial, we've seen how multiple authentication providers can be configured in Spring Security. We have secured a simple application using a custom authentication provider and an in-memory authentication provider.

And we've also written tests to verify that the access to our application requires credentials that can be validated by at least one of our authentication providers.

As always, the full source code of the implementation can be found over on GitHub.

Security bottom

I just announced the new Learn Spring Security course, including the full material focused on the new OAuth2 stack in Spring Security 5: