Class Saml2LogoutConfigurer

java.lang.Object
com.codename1.backend.security.SecurityConfigurer
com.codename1.backend.security.Saml2LogoutConfigurer

public final class Saml2LogoutConfigurer extends SecurityConfigurer

SAML 2.0 Single Logout, front channel, for the users saml2Login signs in:

http.saml2Login(Customizer.withDefaults())
    .saml2Logout(Customizer.withDefaults());
  • Signing out here (the chain's ordinary sign-out, POST /logout) ends the session, then sends the browser to the identity provider with a signed LogoutRequest, so the user is signed out there and of the other applications it signed them in to. The provider answers at /logout/saml2/slo/{registrationId}, and the browser goes on to the chain's sign-out page.
  • Signing out elsewhere: the identity provider sends a signed LogoutRequest to /logout/saml2/slo/{registrationId}; the session of the user it names ends, and the browser is sent back with a signed LogoutResponse.

A registration takes part when it has a signing credential and the identity provider's logout address (from its metadata, or assertingparty.singlelogout.url); for any other, signing out ends the session here alone, as without this configurer. This server's metadata lists its logout address once this is declared.

Prefer the HTTP-Redirect binding for the identity provider's logout address. A logout the identity provider starts arrives as a cross-site request, and only a top-level GET carries the SameSite=Lax session cookie: a request that arrives by POST finds no session, is answered with success, and the session here lives on to its expiry. That is how browsers treat cookies, and Spring Security has the same limit. SOAP (back channel) logout is not supported.