java.lang.Object
org.codelibs.saml2.core.logout.LogoutResponse
LogoutResponse class of Java Toolkit.
A class that implements SAML 2 Logout Response builder/parser/validator
-
Constructor Summary
ConstructorsConstructorDescriptionLogoutResponse(Saml2Settings settings, HttpRequest request) Constructs the LogoutResponse object when a received response should be extracted from the HTTP request and parsed.LogoutResponse(Saml2Settings settings, LogoutResponseParams params) Constructs the LogoutResponse object when a new response should be generated and sent. -
Method Summary
Modifier and TypeMethodDescriptionvoidbuild()Deprecated.voidDeprecated.useLogoutResponse(Saml2Settings, LogoutResponseParams)instead, in which case this method becomes completely useless; indeed, invoking this method in an outgoing logout response scenario will cause the response parameters specified at construction time (inResponseToandresponseStatus) to be overwritten, as well as its generated id and issue instant; on the other hand invoking this method in a received logout response scenario does not make sense at all (and in that caseLogoutResponse(Saml2Settings, HttpRequest)should be used instead)voidDeprecated.useLogoutResponse(Saml2Settings, LogoutResponseParams)instead, in which case this method becomes completely useless; indeed, invoking this method in an outgoing logout response scenario will cause the response parameters specified at construction time (inResponseToandresponseStatus) to be overwritten, as well as its generated id and issue instant; on the other hand invoking this method in a received logout response scenario does not make sense at all (and in that caseLogoutResponse(Saml2Settings, HttpRequest)should be used instead)voidbuild(String inResponseTo, SamlResponseStatus responseStatus) Deprecated.useLogoutResponse(Saml2Settings, LogoutResponseParams)instead, in which case this method becomes completely useless; indeed, invoking this method in an outgoing logout response scenario will cause the response parameters specified at construction time (inResponseToandresponseStatus) to be overwritten, as well as its generated id and issue instant; on the other hand invoking this method in a received logout response scenario does not make sense at all (and in that caseLogoutResponse(Saml2Settings, HttpRequest)should be used instead)getEncodedLogoutResponse(Boolean deflated) getError()After execute a validation process, if fails this method returns the causegetId()Returns the issue instant of this message.Gets the Issuer from Logout Response.Gets the Status of the Logout Response.Gets the Status of the Logout Response.After execute a validation process, if fails this method returns the Exception objectbooleanisValid()booleanDetermines if the SAML LogoutResponse is validprotected StringpostProcessXml(String logoutResponseXml, LogoutResponseParams params, Saml2Settings settings) Allows for an extension class to post-process the LogoutResponse XML generated for this response, in order to customize the result.protected NodeListExtracts nodes that match the query from the DOMDocument (Logout Response Menssage)protected voidsetValidationException(Exception validationException) Sets the validation exception that thisLogoutResponseshould return when a validation error occurs.
-
Constructor Details
-
LogoutResponse
Constructs the LogoutResponse object when a received response should be extracted from the HTTP request and parsed.- Parameters:
settings- OneLogin_Saml2_Settingsrequest- the HttpRequest object to be processed (Contains GET and POST parameters, request URL, ...); may benullwhen building an outgoing logout response
-
LogoutResponse
Constructs the LogoutResponse object when a new response should be generated and sent.- Parameters:
settings- OneLogin_Saml2_Settingsparams- a set of logout response input parameters that shape the request to create
-
-
Method Details
-
getEncodedLogoutResponse
- Parameters:
deflated- If deflated or not the encoded Logout Response- Returns:
- the base64 encoded unsigned Logout Response (deflated or not)
-
getEncodedLogoutResponse
- Returns:
- the base64 encoded, unsigned Logout Response (deflated or not)
-
getLogoutResponseXml
- Returns:
- the plain XML Logout Response
-
getId
- Returns:
- the ID of the Response
-
isValid
Determines if the SAML LogoutResponse is valid- Parameters:
requestId- The ID of the LogoutRequest sent by this SP to the IdP- Returns:
- if the SAML LogoutResponse is or not valid
-
isValid
public boolean isValid() -
getIssuer
Gets the Issuer from Logout Response.- Returns:
- the issuer of the logout response
-
getStatus
Gets the Status of the Logout Response.- Returns:
- the Status
-
getSamlResponseStatus
Gets the Status of the Logout Response.- Returns:
- SamlResponseStatus
-
query
Extracts nodes that match the query from the DOMDocument (Logout Response Menssage)- Parameters:
query- Xpath Expression- Returns:
- DOMNodeList The queried nodes
-
build
Deprecated.useLogoutResponse(Saml2Settings, LogoutResponseParams)instead, in which case this method becomes completely useless; indeed, invoking this method in an outgoing logout response scenario will cause the response parameters specified at construction time (inResponseToandresponseStatus) to be overwritten, as well as its generated id and issue instant; on the other hand invoking this method in a received logout response scenario does not make sense at all (and in that caseLogoutResponse(Saml2Settings, HttpRequest)should be used instead)Generates a Logout Response XML string.- Parameters:
inResponseTo- InResponseTo attribute value to bet set at the Logout Response.responseStatus- SamlResponseStatus response status to be set on the LogoutResponse
-
build
Deprecated.useLogoutResponse(Saml2Settings, LogoutResponseParams)instead, in which case this method becomes completely useless; indeed, invoking this method in an outgoing logout response scenario will cause the response parameters specified at construction time (inResponseToandresponseStatus) to be overwritten, as well as its generated id and issue instant; on the other hand invoking this method in a received logout response scenario does not make sense at all (and in that caseLogoutResponse(Saml2Settings, HttpRequest)should be used instead)Generates a Logout Response XML string.- Parameters:
inResponseTo- InResponseTo attribute value to bet set at the Logout Response.statusCode- String StatusCode to be set on the LogoutResponse
-
build
Deprecated.useLogoutResponse(Saml2Settings, LogoutResponseParams)instead, in which case this method becomes completely useless; indeed, invoking this method in an outgoing logout response scenario will cause the response parameters specified at construction time (inResponseToandresponseStatus) to be overwritten, as well as its generated id and issue instant; on the other hand invoking this method in a received logout response scenario does not make sense at all (and in that caseLogoutResponse(Saml2Settings, HttpRequest)should be used instead)Generates a Logout Response XML string.- Parameters:
inResponseTo- InResponseTo attribute value to bet set at the Logout Response.
-
build
Deprecated.useLogoutResponse(Saml2Settings, LogoutResponseParams)instead, in which case this method becomes completely useless; indeed, invoking this method in an outgoing logout response scenario will cause the response parameters specified at construction time (inResponseToandresponseStatus) to be overwritten, as well as its generated id and issue instant; on the other hand invoking this method in a received logout response scenario does not make sense at all (and in that caseLogoutResponse(Saml2Settings, HttpRequest)should be used instead)Generates a Logout Response XML string. -
postProcessXml
protected String postProcessXml(String logoutResponseXml, LogoutResponseParams params, Saml2Settings settings) Allows for an extension class to post-process the LogoutResponse XML generated for this response, in order to customize the result.This method is invoked by
build(String, String)(and all of its overloadings) and hence only in the logout response sending scenario. Its default implementation simply returns the input XML as-is, with no change.- Parameters:
logoutResponseXml- the XML produced for this LogoutResponse by the standard implementation provided byLogoutResponseparams- the logout request input parameterssettings- the settings- Returns:
- the post-processed XML for this LogoutResponse, which will then be
returned by any call to
getLogoutResponseXml()
-
getError
After execute a validation process, if fails this method returns the cause- Returns:
- the cause of the validation error
-
getValidationException
After execute a validation process, if fails this method returns the Exception object- Returns:
- the cause of the validation error
-
setValidationException
Sets the validation exception that thisLogoutResponseshould return when a validation error occurs.- Parameters:
validationException- the validation exception to set
-
getIssueInstant
Returns the issue instant of this message.- Returns:
- a new
Calendarinstance carrying the issue instant of this message
-
LogoutResponse(Saml2Settings, LogoutResponseParams)instead, in which case this method becomes completely useless; indeed, invoking this method in an outgoing logout response scenario will cause the response parameters specified at construction time (inResponseToandresponseStatus) to be overwritten, as well as its generated id and issue instant; on the other hand invoking this method in a received logout response scenario does not make sense at all (and in that caseLogoutResponse(Saml2Settings, HttpRequest)should be used instead)