shibboleth-2.6.1
shibsp::LogoutHandler Class Reference

Base class for logout-related handlers. More...

#include <shibsp/handler/LogoutHandler.h>

Inheritance diagram for shibsp::LogoutHandler:
shibsp::RemotedHandler shibsp::Handler shibsp::Remoted shibsp::PropertySet shibsp::LogoutInitiator

Public Member Functions

std::pair< bool, long > run (SPRequest &request, bool isHandler=true) const
 The base method will iteratively attempt front-channel notification of logout of the current session, and after the final round trip will perform back-channel notification. More...
 
void receive (DDF &in, std::ostream &out)
 A remoted procedure that will perform any necessary back-channel notifications. More...
 
const char * getEventType () const
 Get the type of event, as input to error handling in response to errors raised by this handler. More...
 
- Public Member Functions inherited from shibsp::Handler
virtual const XMLCh * getProtocolFamily () const
 Returns an identifier for the protocol family associated with the handler, if any. More...
 
virtual void generateMetadata (opensaml::saml2md::SPSSODescriptor &role, const char *handlerURL) const
 Generates and/or modifies metadata reflecting the Handler. More...
 
virtual const char * getType () const
 Returns the "type" of the Handler plugin. More...
 
- Public Member Functions inherited from shibsp::PropertySet
virtual const PropertySetgetParent () const =0
 Returns parent of this PropertySet, if any. More...
 
virtual void setParent (const PropertySet *parent)=0
 Establishes a "parent" PropertySet to supply inherited settings. More...
 
virtual std::pair< bool, bool > getBool (const char *name, const char *ns=nullptr) const =0
 Returns a boolean-valued property. More...
 
virtual std::pair< bool, const char * > getString (const char *name, const char *ns=nullptr) const =0
 Returns a string-valued property. More...
 
virtual std::pair< bool, const XMLCh * > getXMLString (const char *name, const char *ns=nullptr) const =0
 Returns a Unicode string-valued property. More...
 
virtual std::pair< bool, unsigned int > getUnsignedInt (const char *name, const char *ns=nullptr) const =0
 Returns an unsigned integer-valued property. More...
 
virtual std::pair< bool, int > getInt (const char *name, const char *ns=nullptr) const =0
 Returns an integer-valued property. More...
 
virtual void getAll (std::map< std::string, const char *> &properties) const =0
 Returns a map of all known properties in string form. More...
 
virtual const PropertySetgetPropertySet (const char *name, const char *ns=shibspconstants::ASCII_SHIB2SPCONFIG_NS) const =0
 Returns a nested property set. More...
 
virtual const xercesc::DOMElement * getElement () const =0
 Returns a DOM element representing the property container, if any. More...
 

Protected Member Functions

std::pair< bool, long > notifyFrontChannel (const Application &application, const xmltooling::HTTPRequest &request, xmltooling::HTTPResponse &response, const std::map< std::string, std::string > *params=nullptr) const
 Perform front-channel logout notifications for an Application. More...
 
bool notifyBackChannel (const Application &application, const char *requestURL, const std::vector< std::string > &sessions, bool local) const
 Perform back-channel logout notifications for an Application. More...
 
std::pair< bool, long > sendLogoutPage (const Application &application, const xmltooling::HTTPRequest &request, xmltooling::HTTPResponse &response, bool local=true, const char *status=nullptr) const
 
std::pair< bool, long > sendLogoutPage (const Application &application, const xmltooling::HTTPRequest &request, xmltooling::HTTPResponse &response, const char *type) const
 Sends a response template to the user agent informing it of the results of a logout attempt. More...
 
virtual LogoutEventnewLogoutEvent (const Application &application, const xmltooling::HTTPRequest *request=nullptr, const Session *session=nullptr) const
 Creates a new LogoutEvent for the event log. More...
 
- Protected Member Functions inherited from shibsp::RemotedHandler
void setAddress (const char *address)
 Establishes message remoting using the supplied address. More...
 
DDF wrap (const SPRequest &request, const std::vector< std::string > *headers=nullptr, bool certs=false) const
 Wraps a request by creating an outgoing data flow with the data needed to remote the request information. More...
 
virtual std::pair< bool, long > unwrap (SPRequest &request, DDF &out) const
 Unwraps a response by examining an incoming data flow to determine whether a response was produced by the remoted handler. More...
 
xmltooling::HTTPRequest * getRequest (DDF &in) const
 Builds a new request instance around a remoted data object. More...
 
xmltooling::HTTPResponse * getResponse (DDF &out) const
 Builds a new response instance around an outgoing data object. More...
 
- Protected Member Functions inherited from shibsp::Handler
virtual void log (SPRequest::SPLogLevel level, const std::string &msg) const
 Log using handler's specific logging object. More...
 
virtual void cleanRelayState (const Application &application, const xmltooling::HTTPRequest &request, xmltooling::HTTPResponse &response) const
 Prevents unused relay state from building up by cleaning old state from the client. More...
 
virtual void preserveRelayState (const Application &application, xmltooling::HTTPResponse &response, std::string &relayState) const
 Implements various mechanisms to preserve RelayState, such as cookies or StorageService-backed keys. More...
 
virtual void recoverRelayState (const Application &application, const xmltooling::HTTPRequest &request, xmltooling::HTTPResponse &response, std::string &relayState, bool clear=true) const
 Implements various mechanisms to recover RelayState, such as cookies or StorageService-backed keys. More...
 

Protected Attributes

bool m_initiator
 Flag indicating whether the subclass is acting as a LogoutInitiator. More...
 
std::vector< std::string > m_preserve
 Array of query string parameters to preserve across front-channel notifications, if present. More...
 
- Protected Attributes inherited from shibsp::RemotedHandler
std::string m_address
 Message address for remote half. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from shibsp::RemotedHandler
static void addRemotedHeader (const char *header)
 Ensures that a request header will be remoted. More...
 

Detailed Description

Base class for logout-related handlers.

Member Function Documentation

◆ getEventType()

const char* shibsp::LogoutHandler::getEventType ( ) const
virtual

Get the type of event, as input to error handling in response to errors raised by this handler.

Returns
an event type for error handling

Reimplemented from shibsp::Handler.

◆ newLogoutEvent()

virtual LogoutEvent* shibsp::LogoutHandler::newLogoutEvent ( const Application application,
const xmltooling::HTTPRequest *  request = nullptr,
const Session session = nullptr 
) const
protectedvirtual

Creates a new LogoutEvent for the event log.

Parameters
applicationthe Application associated with the event
requestthe HTTP client request associated with the event, or nullptr
sessionthe user session associated with the event, or nullptr
Returns
a fresh LogoutEvent, prepopulated by the input parameters, or nullptr if an error occurs

◆ notifyBackChannel()

bool shibsp::LogoutHandler::notifyBackChannel ( const Application application,
const char *  requestURL,
const std::vector< std::string > &  sessions,
bool  local 
) const
protected

Perform back-channel logout notifications for an Application.

Parameters
applicationthe Application to notify
requestURLrequestURL that resulted in method call
sessionsarray of session keys being logged out
localtrue iff the logout operation is local to the SP, false iff global
Returns
true iff all notifications succeeded

◆ notifyFrontChannel()

std::pair<bool,long> shibsp::LogoutHandler::notifyFrontChannel ( const Application application,
const xmltooling::HTTPRequest &  request,
xmltooling::HTTPResponse &  response,
const std::map< std::string, std::string > *  params = nullptr 
) const
protected

Perform front-channel logout notifications for an Application.

Parameters
applicationthe Application to notify
requestlast request from browser
responseresponse to use for next notification
paramsmap of query string parameters to preserve across this notification
Returns
indicator of a completed response along with the status code to return from the handler

◆ receive()

void shibsp::LogoutHandler::receive ( DDF in,
std::ostream &  out 
)
virtual

A remoted procedure that will perform any necessary back-channel notifications.

The input structure must contain an "application_id" member, and a "sessions" list containing the session keys, along with an integer member called "notify" with a value of 1.

Parameters
inincoming DDF message
outstream to write outgoing DDF message to

Implements shibsp::Remoted.

◆ run()

std::pair<bool,long> shibsp::LogoutHandler::run ( SPRequest request,
bool  isHandler = true 
) const
virtual

The base method will iteratively attempt front-channel notification of logout of the current session, and after the final round trip will perform back-channel notification.

Nothing will be done unless the handler detects that it is the "top" level logout handler. If the method returns false, then the specialized class should perform its work assuming that the notifications are completed.

Note that the current session is NOT removed from the cache.

Parameters
requestSP request context
isHandlertrue iff executing in the context of a direct handler invocation
Returns
a pair containing a "request completed" indicator and a server-specific response code

Implements shibsp::Handler.

◆ sendLogoutPage() [1/2]

std::pair<bool,long> shibsp::LogoutHandler::sendLogoutPage ( const Application application,
const xmltooling::HTTPRequest &  request,
xmltooling::HTTPResponse &  response,
bool  local = true,
const char *  status = nullptr 
) const
protected
Deprecated:
Sends a response template to the user agent informing it of the results of a logout attempt.
Parameters
applicationthe Application to use in determining the logout template
requestthe HTTP client request to supply to the template
responsethe HTTP response to use
localtrue iff the logout operation was local to the SP, false iff global
statusoptional logoutStatus key value to add to template

◆ sendLogoutPage() [2/2]

std::pair<bool,long> shibsp::LogoutHandler::sendLogoutPage ( const Application application,
const xmltooling::HTTPRequest &  request,
xmltooling::HTTPResponse &  response,
const char *  type 
) const
protected

Sends a response template to the user agent informing it of the results of a logout attempt.

Parameters
applicationthe Application to use in determining the logout template
requestthe HTTP client request to supply to the template
responsethe HTTP response to use
typedesignates the prefix of logout template name to use

Member Data Documentation

◆ m_initiator

bool shibsp::LogoutHandler::m_initiator
protected

Flag indicating whether the subclass is acting as a LogoutInitiator.

◆ m_preserve

std::vector<std::string> shibsp::LogoutHandler::m_preserve
protected

Array of query string parameters to preserve across front-channel notifications, if present.


The documentation for this class was generated from the following file: