Package com.sun.identity.saml2.profile
Class IDPSingleLogout
- java.lang.Object
-
- com.sun.identity.saml2.profile.IDPSingleLogout
-
public class IDPSingleLogout extends Object
This class reads the required data from HttpServletRequest and initiates theLogoutRequestfrom IDP to SP.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetSingleLogoutLocation(String spEntityID, String realm, String binding)Returns single logout location for the service provider.static List<SingleLogoutServiceElement>getSPSLOServiceEndpoints(String realm, String spEntityID)Gets the single log out end points for the Service Provider.static voidinitiateLogoutRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, PrintWriter out, String binding, Map paramsMap)Parses the request parameters and initiates the Logout Request to be sent to the SP.static LogoutResponseprocessLogoutRequest(LogoutRequest logoutReq, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, PrintWriter out, String binding, String relayState, String idpEntityID, String realm, boolean isVerified)Gets and processes the SingleLogoutRequestfrom SP and returnLogoutResponse.static voidprocessLogoutRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, PrintWriter out, String samlRequest, String relayState)Gets and processes the SingleLogoutRequestfrom SP.static booleanprocessLogoutResponse(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, PrintWriter out, String samlResponse, String relayState)Gets and processes the SingleLogoutResponsefrom SP, destroys the local session, checks response's issuer and inResponseTo.
-
-
-
Method Detail
-
initiateLogoutRequest
public static void initiateLogoutRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, PrintWriter out, String binding, Map paramsMap) throws SAML2ExceptionParses the request parameters and initiates the Logout Request to be sent to the SP.- Parameters:
request- the HttpServletRequest.response- the HttpServletResponse.out- the print writer for writing out presentationbinding- binding used for this request.paramsMap- Map of all other parameters. Following parameters names with their respective String values are allowed in this paramsMap. "RelayState" - the target URL on successful Single Logout "Destination" - A URI Reference indicating the address to which the request has been sent. "Consent" - Specifies a URI a SAML defined identifier known as Consent Identifiers. "Extension" - Specifies a list of Extensions as list of String objects.- Throws:
SAML2Exception- if error initiating request to SP.
-
processLogoutRequest
public static void processLogoutRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, PrintWriter out, String samlRequest, String relayState) throws SAML2Exception, SessionExceptionGets and processes the SingleLogoutRequestfrom SP.- Parameters:
request- the HttpServletRequest.response- the HttpServletResponse.out- the print writer for writing out presentationsamlRequest-LogoutRequestin the XML string format.relayState- the target URL on successfulLogoutRequest.- Throws:
SAML2Exception- if error processingLogoutRequest.SessionException- if error processingLogoutRequest.
-
getSingleLogoutLocation
public static String getSingleLogoutLocation(String spEntityID, String realm, String binding) throws SAML2Exception
Returns single logout location for the service provider.- Throws:
SAML2Exception
-
processLogoutResponse
public static boolean processLogoutResponse(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, PrintWriter out, String samlResponse, String relayState) throws SAML2Exception, SessionExceptionGets and processes the SingleLogoutResponsefrom SP, destroys the local session, checks response's issuer and inResponseTo.- Parameters:
request- the HttpServletRequest.response- the HttpServletResponse.out- the print writer for writing out presentationsamlResponse-LogoutResponsein the XML string format.relayState- the target URL on successfulLogoutResponse.- Returns:
- true if jsp has sendRedirect for relayState, false otherwise
- Throws:
SAML2Exception- if error processingLogoutResponse.SessionException- if error processingLogoutResponse.
-
processLogoutRequest
public static LogoutResponse processLogoutRequest(LogoutRequest logoutReq, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, PrintWriter out, String binding, String relayState, String idpEntityID, String realm, boolean isVerified) throws SAML2Exception
Gets and processes the SingleLogoutRequestfrom SP and returnLogoutResponse.- Parameters:
logoutReq-LogoutRequestfrom SPrequest- the HttpServletRequest.response- the HttpServletResponse.out- the print writer for writing out presentationbinding- name of binding will be used for request processing.relayState- the relay state.idpEntityID- name of host entity ID.realm- name of host entity.isVerified- true if the request is verified already.- Returns:
- LogoutResponse the target URL on successful
LogoutRequest. - Throws:
SAML2Exception- if error processingLogoutRequest.
-
getSPSLOServiceEndpoints
public static List<SingleLogoutServiceElement> getSPSLOServiceEndpoints(String realm, String spEntityID) throws SAML2Exception
Gets the single log out end points for the Service Provider.- Parameters:
realm- the realm that the service provider is configured withinspEntityID- the id for the service provider configuration entity- Returns:
- a list of Single Logout Service elements
- Throws:
SAML2Exception- if there was a problem retrieving the SP SSO Descriptor Element
-
-