Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The general approach is:</p> <p>1) Subclass AbstractAuthenticationToken for your XML logins, let's call it XMLAuthenticationToken.</p> <p>2) Subclass AbstractAuthenticationProcessingFilter and add it to the filter chain after UsernamePasswordAuthenticationFilter. It should create a XMLAuthenticationToken based on the data in the XML. You can use UsernamePasswordAuthenticationFilter as an example for the general structure of the filter (that's most likely the filter that you are currently using for your regular Spring Security logins).</p> <pre><code>&lt;http&gt; &lt;custom-filter after="FORM_LOGIN_FILTER" ref="xmlAuthenticationFilter"/&gt; &lt;/http&gt; </code></pre> <p>The filter should set a filterProcessesUrl that is different from the UsernamePasswordFilter. This is the URL the external system will post the XML to. For example:</p> <pre><code>public XmlAuthenticationFilter() { super("/xml_security_check"); } </code></pre> <p>3) Subclass AbstractUserDetailsAuthenticationProvider. Have it look up the user from the UserDetailsService based on the info in the token, and then authenticate it. Use DaoAuthenticationProvider as an example. You will need to register the new provider with the AuthenticationManager.</p> <pre><code>&lt;authentication-manager&gt; &lt;authentication-provider user-service-ref='myUserDetailsService'/&gt; &lt;authentication-provider ref="xmlAuthenticationProvider" /&gt; &lt;/authentication-manager&gt; </code></pre> <p>You might be able to get away with reusing UsernamePasswordAuthenticationToken (for #1, it has a nice "details" extension mechanism) and DaoAuthenticationProvider (or subclassing it) for #3.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload