Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could create a DelegatingAuthenticationEntryPoint that would delegate to the standard CasAuthenticationEntryPoint if the CAS Server was up or otherwise delegate to the LoginUrlAuthenticationEntryPoint. The implementation would look something like the following</p> <pre><code>public class DelegatingAuthenticationEntryPoint implements AuthenticationEntryPoint { private AuthenticationEntryPoint casAuthenticationEntryPoint; private AuthenticationEntryPoint ldapAuthenticationEntryPoint; public DelegatingAuthenticationEntryPoint(AuthenticationEntryPoint casAuthenticationEntryPoint, AuthenticationEntryPoint ldapAuthenticationEntryPoint) { this.casAuthenticationEntryPoint = casAuthenticationEntryPoint; this.ldapAuthenticationEntryPoint = ldapAuthenticationEntryPoint; } public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { if(casServerAvailable()) { casAuthenticationEntryPoint.commence(request, response, authException); } else { ldapAuthenticationEntryPoint.commence(request, response, authException); } } private boolean casServerAvailable() { // TODO implement this method return false; } } </code></pre> <p>You would then wire the DelegatingAuthenticationEntryPoint using the entry-point-ref attribute similar to the following:</p> <pre><code> &lt;sec:http entry-point-ref="delegateEntryPoint"&gt; ... &lt;/sec:http&gt; &lt;bean id="delegateEntryPoint" class="sample.DelegatingAuthenticationEntryPoint"&gt; &lt;constructor-arg&gt; &lt;bean class="org.springframework.security.cas.web.CasAuthenticationEntryPoint" p:serviceProperties-ref="serviceProperties" p:loginUrl="https://example.com/cas/login" /&gt; &lt;/constructor-arg&gt; &lt;constructor-arg&gt; &lt;bean class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint" p:loginFormUrl="/login"/&gt; &lt;/constructor-arg&gt; &lt;/bean&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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