Class Saml2Logout
java.lang.Object
com.codename1.backend.security.saml2.Saml2Logout
SAML Single Logout, front channel: the LogoutRequest and
LogoutResponse this server sends, and the checks on the ones it receives.
Every logout message is signed both ways. One this server sends is signed with the registration's signing key, so a registration without one cannot take part in Single Logout; one it receives must carry a signature that verifies under the identity provider's certificates -- in the query for the HTTP-Redirect binding, enveloped in the XML for HTTP-POST. An unsigned logout request is refused, since anyone could otherwise end anyone's session.
SOAP (back channel) logout is not supported, as it is not by Spring Security.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA logout message this server received, after every check passed. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Saml2Logout.ReceivedreadPost(RelyingPartyRegistration registration, String parameter, String value, String relayState, String sloLocation, long now) Reads and checks a logout message that arrived by HTTP-POST.static Saml2Logout.ReceivedreadRedirect(RelyingPartyRegistration registration, String rawQuery, String sloLocation, long now) Reads and checks a logout message that arrived by HTTP-Redirect.static Saml2Messagerequest(RelyingPartyRegistration registration, Saml2AuthenticatedPrincipal principal, String entityId, String relayState, long now) TheLogoutRequestthat endsprincipal's session at the identity provider.static Saml2Messageresponse(RelyingPartyRegistration registration, String inResponseTo, String status, String entityId, String relayState, long now) TheLogoutResponseanswering the identity provider's requestinResponseTo.
-
Field Details
-
SUCCESS
-
REQUESTER
The status of an answer to a request that names someone else.- See Also:
-
-
Method Details
-
request
public static Saml2Message request(RelyingPartyRegistration registration, Saml2AuthenticatedPrincipal principal, String entityId, String relayState, long now) throws IOException TheLogoutRequestthat endsprincipal's session at the identity provider.- Parameters:
entityId- this server's entity ID, resolved- Throws:
IllegalStateException- when the registration has no logout address or no signing keyIOException
-
response
public static Saml2Message response(RelyingPartyRegistration registration, String inResponseTo, String status, String entityId, String relayState, long now) throws IOException TheLogoutResponseanswering the identity provider's requestinResponseTo.- Parameters:
status-SUCCESS, or another status code- Throws:
IOException
-
readRedirect
public static Saml2Logout.Received readRedirect(RelyingPartyRegistration registration, String rawQuery, String sloLocation, long now) Reads and checks a logout message that arrived by HTTP-Redirect.- Parameters:
rawQuery- the query exactly as it arrived, still percent encoded: the signature is over those bytessloLocation- this server's logout address for the registration, resolved- Throws:
Saml2AuthenticationException- when it is refused
-
readPost
public static Saml2Logout.Received readPost(RelyingPartyRegistration registration, String parameter, String value, String relayState, String sloLocation, long now) Reads and checks a logout message that arrived by HTTP-POST.- Parameters:
parameter-SAMLRequestorSAMLResponsevalue- the posted parameter, base64- Throws:
Saml2AuthenticationException- when it is refused
-