java.lang.Object
org.codelibs.saml2.core.logout.LogoutRequest
LogoutRequest class of Java Toolkit.
A class that implements SAML 2 Logout Request builder/parser/validator
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLogoutRequest(Saml2Settings settings) Constructs a LogoutRequest object when a new request should be generated and sent.LogoutRequest(Saml2Settings settings, HttpRequest request) Constructs the LogoutRequest object when a received request should be extracted from the HTTP request and parsed.LogoutRequest(Saml2Settings settings, HttpRequest request, String nameId, String sessionIndex) Deprecated.LogoutRequest(Saml2Settings settings, HttpRequest request, String nameId, String sessionIndex, String nameIdFormat) Deprecated.useLogoutRequest(Saml2Settings, HttpRequest)to build a received request from the HTTP request, orLogoutRequest(Saml2Settings, LogoutRequestParams)withLogoutRequestParams(String, String, String)to build a new request to be sentLogoutRequest(Saml2Settings settings, HttpRequest request, String nameId, String sessionIndex, String nameIdFormat, String nameIdNameQualifier) Deprecated.useLogoutRequest(Saml2Settings, HttpRequest)to build a received request from the HTTP request, orLogoutRequest(Saml2Settings, LogoutRequestParams)withLogoutRequestParams(String, String, String, String)to build a new request to be sentLogoutRequest(Saml2Settings settings, HttpRequest request, String nameId, String sessionIndex, String nameIdFormat, String nameIdNameQualifier, String nameIdSPNameQualifier) Deprecated.useLogoutRequest(Saml2Settings, HttpRequest)to build a received request from the HTTP request, orLogoutRequest(Saml2Settings, LogoutRequestParams)withLogoutRequestParams(String, String, String, String, String)to build a new request to be sentLogoutRequest(Saml2Settings settings, LogoutRequestParams params) Constructs the LogoutRequest object when a new request should be generated and sent. -
Method Summary
Modifier and TypeMethodDescriptiongetEncodedLogoutRequest(Boolean deflated) getError()After execute a validation process, if fails this method returns the causegetId()static StringReturns the ID of the Logout Request String.static StringReturns the ID of the Logout Request Document.Returns the issue instant of this message.static CalendargetIssueInstant(String samlLogoutRequestString) Returns the issue instant of the Logout Request Document.static CalendargetIssueInstant(Document samlLogoutRequestDocument) Returns the issue instant of the Logout Request Document.static StringGets the Issuer from Logout Request String.static StringGets the Issuer from Logout Request String.static StringGets the Issuer from Logout Request Document.static StringGets the Issuer from Logout Request Document.static StringGets the NameID value provided from the SAML Logout Request String.static StringgetNameId(String samlLogoutRequestString, PrivateKey key) Gets the NameID value provided from the SAML Logout Request String.static StringgetNameId(String samlLogoutRequestString, PrivateKey key, boolean trimValue) Gets the NameID value provided from the SAML Logout Request String.static StringGets the NameID value provided from the SAML Logout Request Document.static StringgetNameId(Document samlLogoutRequestDocument, PrivateKey key) Gets the NameID value provided from the SAML Logout Request Document.static StringgetNameId(Document samlLogoutRequestDocument, PrivateKey key, boolean trimValue) Gets the NameID value provided from the SAML Logout Request Document.getNameIdData(String samlLogoutRequestString, PrivateKey key) Gets the NameID Data from the the Logout Request String.getNameIdData(String samlLogoutRequestString, PrivateKey key, boolean trimValue) Gets the NameID Data from the the Logout Request String.getNameIdData(Document samlLogoutRequestDocument, PrivateKey key) Gets the NameID Data from the the Logout Request Document.getNameIdData(Document samlLogoutRequestDocument, PrivateKey key, boolean trimValue) Gets the NameID Data from the the Logout Request Document.getSessionIndexes(String samlLogoutRequestString) Gets the SessionIndexes from the LogoutRequest.getSessionIndexes(String samlLogoutRequestString, boolean trim) Gets the SessionIndexes from the LogoutRequest.getSessionIndexes(Document samlLogoutRequestDocument) Gets the SessionIndexes from the LogoutRequest.getSessionIndexes(Document samlLogoutRequestDocument, boolean trim) Gets the SessionIndexes from the LogoutRequest.After execute a validation process, if fails this method returns the Exception objectbooleanisValid()Determines if the SAML LogoutRequest is valid or notprotected StringpostProcessXml(String logoutRequestXml, LogoutRequestParams params, Saml2Settings settings) Allows for an extension class to post-process the LogoutRequest XML generated for this request, in order to customize the result.protected voidsetValidationException(Exception validationException) Sets the validation exception that thisLogoutRequestshould return when a validation error occurs.
-
Field Details
-
id
SAML LogoutRequest ID.
-
-
Constructor Details
-
LogoutRequest
@Deprecated public LogoutRequest(Saml2Settings settings, HttpRequest request, String nameId, String sessionIndex, String nameIdFormat, String nameIdNameQualifier, String nameIdSPNameQualifier) Deprecated.useLogoutRequest(Saml2Settings, HttpRequest)to build a received request from the HTTP request, orLogoutRequest(Saml2Settings, LogoutRequestParams)withLogoutRequestParams(String, String, String, String, String)to build a new request to be sentConstructs the LogoutRequest object.- Parameters:
settings- OneLogin_Saml2_Settingsrequest- the HttpRequest object to be processed (Contains GET and POST parameters, request URL, ...).nameId- The NameID that will be set in the LogoutRequest.sessionIndex- The SessionIndex (taken from the SAML Response in the SSO process).nameIdFormat- The nameIdFormat that will be set in the LogoutRequest.nameIdNameQualifier- The NameID NameQualifier that will be set in the LogoutRequest.nameIdSPNameQualifier- The SP Name Qualifier that will be set in the LogoutRequest.
-
LogoutRequest
@Deprecated public LogoutRequest(Saml2Settings settings, HttpRequest request, String nameId, String sessionIndex, String nameIdFormat, String nameIdNameQualifier) Deprecated.useLogoutRequest(Saml2Settings, HttpRequest)to build a received request from the HTTP request, orLogoutRequest(Saml2Settings, LogoutRequestParams)withLogoutRequestParams(String, String, String, String)to build a new request to be sentConstructs the LogoutRequest object.- Parameters:
settings- OneLogin_Saml2_Settingsrequest- the HttpRequest object to be processed (Contains GET and POST parameters, request URL, ...).nameId- The NameID that will be set in the LogoutRequest.sessionIndex- The SessionIndex (taken from the SAML Response in the SSO process).nameIdFormat- The nameIdFormat that will be set in the LogoutRequest.nameIdNameQualifier- The NameID NameQualifier will be set in the LogoutRequest.
-
LogoutRequest
@Deprecated public LogoutRequest(Saml2Settings settings, HttpRequest request, String nameId, String sessionIndex, String nameIdFormat) Deprecated.useLogoutRequest(Saml2Settings, HttpRequest)to build a received request from the HTTP request, orLogoutRequest(Saml2Settings, LogoutRequestParams)withLogoutRequestParams(String, String, String)to build a new request to be sentConstructs the LogoutRequest object.- Parameters:
settings- OneLogin_Saml2_Settingsrequest- the HttpRequest object to be processed (Contains GET and POST parameters, request URL, ...).nameId- The NameID that will be set in the LogoutRequest.sessionIndex- The SessionIndex (taken from the SAML Response in the SSO process).nameIdFormat- The nameIdFormat that will be set in the LogoutRequest.
-
LogoutRequest
@Deprecated public LogoutRequest(Saml2Settings settings, HttpRequest request, String nameId, String sessionIndex) Deprecated.useLogoutRequest(Saml2Settings, HttpRequest)to build a received request from the HTTP request, orLogoutRequest(Saml2Settings, LogoutRequestParams)withLogoutRequestParams(String, String)to build a new request to be sentConstructs the LogoutRequest object.- Parameters:
settings- OneLogin_Saml2_Settingsrequest- the HttpRequest object to be processed (Contains GET and POST parameters, request URL, ...).nameId- The NameID that will be set in the LogoutRequest.sessionIndex- The SessionIndex (taken from the SAML Response in the SSO process).
-
LogoutRequest
Constructs a LogoutRequest object when a new request should be generated and sent.- Parameters:
settings- OneLogin_Saml2_Settings- See Also:
-
LogoutRequest
Constructs the LogoutRequest object when a received request 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, ...).
-
LogoutRequest
Constructs the LogoutRequest object when a new request should be generated and sent.- Parameters:
settings- OneLogin_Saml2_Settingsparams- a set of logout request input parameters that shape the request to create
-
-
Method Details
-
postProcessXml
protected String postProcessXml(String logoutRequestXml, LogoutRequestParams params, Saml2Settings settings) Allows for an extension class to post-process the LogoutRequest XML generated for this request, in order to customize the result.This method is invoked at construction time when no existing LogoutRequest message is found in the HTTP request (and hence in the logout request sending scenario only), after all the other fields of this class have already been initialised. Its default implementation simply returns the input XML as-is, with no change.
- Parameters:
logoutRequestXml- the XML produced for this LogoutRequest by the standard implementation provided byLogoutRequestparams- the logout request input parameterssettings- the settings- Returns:
- the post-processed XML for this LogoutRequest, which will then be
returned by any call to
getLogoutRequestXml()
-
getEncodedLogoutRequest
- Parameters:
deflated- If deflated or not the encoded Logout Request- Returns:
- the base64 encoded unsigned Logout Request (deflated or not)
-
getEncodedLogoutRequest
- Returns:
- the base64 encoded unsigned Logout Request (deflated or not)
-
getLogoutRequestXml
- Returns:
- the plain XML Logout Request
-
isValid
public boolean isValid()Determines if the SAML LogoutRequest is valid or not- Returns:
- true if the SAML LogoutRequest is valid
-
getId
Returns the ID of the Logout Request Document.- Parameters:
samlLogoutRequestDocument- A DOMDocument object loaded from the SAML Logout Request.- Returns:
- the ID of the Logout Request.
-
getIssueInstant
Returns the issue instant of the Logout Request Document.- Parameters:
samlLogoutRequestDocument- A DOMDocument object loaded from the SAML Logout Request.- Returns:
- the issue instant of the Logout Request.
-
getId
Returns the ID of the Logout Request String.- Parameters:
samlLogoutRequestString- A Logout Request string.- Returns:
- the ID of the Logout Request.
-
getIssueInstant
Returns the issue instant of the Logout Request Document.- Parameters:
samlLogoutRequestString- A DOMDocument object loaded from the SAML Logout Request.- Returns:
- the issue instant of the Logout Request.
-
getNameIdData
Gets the NameID Data from the the Logout Request Document.- Parameters:
samlLogoutRequestDocument- A DOMDocument object loaded from the SAML Logout Request.key- The SP key to decrypt the NameID if encrypted- Returns:
- the Name ID Data (Value, Format, NameQualifier, SPNameQualifier)
-
getNameIdData
public static Map<String,String> getNameIdData(Document samlLogoutRequestDocument, PrivateKey key, boolean trimValue) Gets the NameID Data from the the Logout Request Document.- Parameters:
samlLogoutRequestDocument- A DOMDocument object loaded from the SAML Logout Request.key- The SP key to decrypt the NameID if encryptedtrimValue- whether the extracted Name ID value should be trimmed- Returns:
- the Name ID Data (Value, Format, NameQualifier, SPNameQualifier)
-
getNameIdData
Gets the NameID Data from the the Logout Request String.- Parameters:
samlLogoutRequestString- A DOMDocument object loaded from the SAML Logout Request.key- The SP key to decrypt the NameID if encrypted- Returns:
- the Name ID Data (Value, Format, NameQualifier, SPNameQualifier)
-
getNameIdData
public static Map<String,String> getNameIdData(String samlLogoutRequestString, PrivateKey key, boolean trimValue) Gets the NameID Data from the the Logout Request String.- Parameters:
samlLogoutRequestString- A DOMDocument object loaded from the SAML Logout Request.key- The SP key to decrypt the NameID if encryptedtrimValue- whether the extracted Name ID value should be trimmed- Returns:
- the Name ID Data (Value, Format, NameQualifier, SPNameQualifier)
-
getNameId
Gets the NameID value provided from the SAML Logout Request Document.- Parameters:
samlLogoutRequestDocument- A DOMDocument object loaded from the SAML Logout Request.key- The SP key to decrypt the NameID if encrypted- Returns:
- the Name ID value
-
getNameId
public static String getNameId(Document samlLogoutRequestDocument, PrivateKey key, boolean trimValue) Gets the NameID value provided from the SAML Logout Request Document.- Parameters:
samlLogoutRequestDocument- A DOMDocument object loaded from the SAML Logout Request.key- The SP key to decrypt the NameID if encryptedtrimValue- whether the extracted Name ID value should be trimmed- Returns:
- the Name ID value
-
getNameId
Gets the NameID value provided from the SAML Logout Request Document.- Parameters:
samlLogoutRequestDocument- A DOMDocument object loaded from the SAML Logout Request.- Returns:
- the Name ID value
-
getNameId
Gets the NameID value provided from the SAML Logout Request String.- Parameters:
samlLogoutRequestString- A Logout Request string.key- The SP key to decrypt the NameID if encrypted- Returns:
- the Name ID value
-
getNameId
Gets the NameID value provided from the SAML Logout Request String.- Parameters:
samlLogoutRequestString- A Logout Request string.key- The SP key to decrypt the NameID if encryptedtrimValue- whether the extracted Name ID value should be trimmed- Returns:
- the Name ID value
-
getNameId
Gets the NameID value provided from the SAML Logout Request String.- Parameters:
samlLogoutRequestString- A Logout Request string.- Returns:
- the Name ID value
-
getIssuer
Gets the Issuer from Logout Request Document.- Parameters:
samlLogoutRequestDocument- A DOMDocument object loaded from the SAML Logout Request.- Returns:
- the issuer of the logout request
-
getIssuer
Gets the Issuer from Logout Request Document.- Parameters:
samlLogoutRequestDocument- A DOMDocument object loaded from the SAML Logout Request.trim- whether the extracted issuer value should be trimmed- Returns:
- the issuer of the logout request
-
getIssuer
Gets the Issuer from Logout Request String.- Parameters:
samlLogoutRequestString- A Logout Request string.- Returns:
- the issuer of the logout request
-
getIssuer
Gets the Issuer from Logout Request String.- Parameters:
samlLogoutRequestString- A Logout Request string.trim- whether the extracted issuer value should be trimmed- Returns:
- the issuer of the logout request
-
getSessionIndexes
Gets the SessionIndexes from the LogoutRequest.- Parameters:
samlLogoutRequestDocument- A DOMDocument object loaded from the SAML Logout Request.- Returns:
- the SessionIndexes
-
getSessionIndexes
Gets the SessionIndexes from the LogoutRequest.- Parameters:
samlLogoutRequestDocument- A DOMDocument object loaded from the SAML Logout Request.trim- whether the extracted session indexes should be trimmed- Returns:
- the SessionIndexes
-
getSessionIndexes
Gets the SessionIndexes from the LogoutRequest.- Parameters:
samlLogoutRequestString- A Logout Request string.- Returns:
- the SessionIndexes
-
getSessionIndexes
Gets the SessionIndexes from the LogoutRequest.- Parameters:
samlLogoutRequestString- A Logout Request string.trim- whether the extracted session indexes should be trimmed- Returns:
- the SessionIndexes
-
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 thisLogoutRequestshould return when a validation error occurs.- Parameters:
validationException- the validation exception to set
-
getId
- Returns:
- the ID of the Logout Request
-
getIssueInstant
Returns the issue instant of this message.- Returns:
- a new
Calendarinstance carrying the issue instant of this message
-
LogoutRequest(Saml2Settings, HttpRequest)to build a received request from the HTTP request, orLogoutRequest(Saml2Settings, LogoutRequestParams)withLogoutRequestParams(String, String)to build a new request to be sent