Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class Saml2Logout
- Object
- 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 types
class Saml2Logout.Received | A logout message this server received, after every check passed. |
Fields
public static final String SUCCESS = "urn:oasis:names:tc:SAML:2.0:status:Success" | urn:oasis:names:tc:SAML:2.0:status:Success. |
public static final String REQUESTER = "urn:oasis:names:tc:SAML:2.0:status:Requester" | The status of an answer to a request that names someone else. |
Methods
Inherited methods
Field details
SUCCESS
public static final String SUCCESS = "urn:oasis:names:tc:SAML:2.0:status:Success"urn:oasis:names:tc:SAML:2.0:status:Success.REQUESTER
public static final String REQUESTER = "urn:oasis:names:tc:SAML:2.0:status:Requester"The status of an answer to a request that names someone else.
Method details
request
public static Saml2Message request(RelyingPartyRegistration registration, Saml2AuthenticatedPrincipal principal, String entityId, String relayState, long now)
throws IOExceptionThe
LogoutRequest that ends principal’s session at the identity
provider.Parameters
registrationRelyingPartyRegistration- Not documented.
principalSaml2AuthenticatedPrincipal- Not documented.
entityIdString- this server’s entity ID, resolved
relayStateString- Not documented.
nowlong- Not documented.
Throws
IllegalStateException- when the registration has no logout address or no signing key
IOException
response
public static Saml2Message response(RelyingPartyRegistration registration, String inResponseTo, String status, String entityId, String relayState, long now)
throws IOExceptionThe
LogoutResponse answering the identity provider’s request inResponseTo.Parameters
registrationRelyingPartyRegistration- Not documented.
inResponseToString- Not documented.
statusStringSUCCESS, or another status codeentityIdString- Not documented.
relayStateString- Not documented.
nowlong- Not documented.
Throws
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
registrationRelyingPartyRegistration- Not documented.
rawQueryString- the query exactly as it arrived, still percent encoded: the signature is over those bytes
sloLocationString- this server’s logout address for the registration, resolved
nowlong- Not documented.
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
registrationRelyingPartyRegistration- Not documented.
parameterStringSAMLRequestorSAMLResponsevalueString- the posted parameter, base64
relayStateString- Not documented.
sloLocationString- Not documented.
nowlong- Not documented.
Throws
Saml2AuthenticationException- when it is refused