Search code examples
spring-securityjaas

How to configure spring security with custom JAAS stack?


I have followed this tutorial in order to add basic spring security to my spring mvcbasedweb app.

Before adding the spring security layer my app was protected using acustom SSO login module configured in my web.xml:

 <login-config>
        <auth-method>MyLoginModule</auth-method>
    </login-config>

This login module takescare of redirecting to the login form, performing login etc. and isworking asexpected. After adding the basic spring security layer the app is redirecting to my custom login page and when I authenticate pass me through yet another authentication using spring's standard "Login with Username and Password" form.

My question is how to configure spring to only use my login-config above to perform the authentication and remove it's redundant own "built in" form?


Solution

  • I found what I was looking for in the Spring Security reference. Specifically, the chapter on Java Authentication and Authorization Service (JAAS) Provider.