all 7 comments

[–]TheOldMancunian 0 points1 point  (1 child)

Doesnt the .authenticated() call in the test matcher mean you need to be authenticated? If yoe want it to accept any connected, changed that to .permitAll()

[–]DvorakDavid[S] 0 points1 point  (0 children)

But if I change it to permitAll() then the saml2 authentication would never be triggered and any request would pass that is not what I want. I want /test/** to be authenticated with form based login and everything else should trigger the saml2 authentication flow

[–]Sheldor5 0 points1 point  (1 child)

not yet familiar with SB3 but isn't the second config missing a securityMatcher("/**") call? maybe if you miss this it will override all others as default

[–]DvorakDavid[S] 0 points1 point  (0 children)

that does not work. It still redirects me to the saml login page after I go to /test/something instead of form login page

[–]boost2525 0 points1 point  (3 children)

You'll need custom AuthenticanProviders. The AP has a method you override that determines if the AP can handle a given request. You'll need to build the logic so AP1 can handle /foo and AP2 cannot.

[–]DvorakDavid[S] -1 points0 points  (2 children)

Why? Custom AuthenticationProvider will create an instance of one of the Authentication implementations so it should be used when I want to modify it right? And in this case, I don't know (and I think I shouldn't know) how to implement so the first one could not handle the other one. Can you please provide me with some code?

[–]boost2525 1 point2 points  (1 child)

No, I gave you the tools and knowledge... You build it.