logout_request.py

About this file

We attempted to read from templates/app_lib_onelogin_saml2_logout_request.py_hw.txt but failed.

Code Check Report


app/lib/onelogin/saml2/logout_request.py:175:121: E501 line too long (125 > 120 characters)
app/lib/onelogin/saml2/logout_request.py:286:121: E501 line too long (126 > 120 characters)
                        

Documentation drawn from source code

OneLogin_Saml2_Logout_Request class

Copyright (c) 2010-2018 OneLogin, Inc.
MIT License

Logout Request class of OneLogin's Python Toolkit.


OneLogin_Saml2_Logout_Request(object):


This class handles a Logout Request.

Builds a Logout Response object and validates it.


__init__(self, settings, request=None, name_id=None, session_index=None, nq=None, name_id_format=None):

Constructs the Logout Request object.

:param settings: Setting data
:type settings: OneLogin_Saml2_Settings

:param request: Optional. A LogoutRequest to be loaded instead build one.
:type request: string

:param name_id: The NameID that will be set in the LogoutRequest.
:type name_id: string

:param session_index: SessionIndex that identifies the session of the user.
:type session_index: string

:param nq: IDP Name Qualifier
:type: string

:param name_id_format: The NameID Format that will be set in the LogoutRequest.
:type: string

get_request(self, deflate=True):

Returns the Logout Request deflated, base64encoded
:param deflate: It makes the deflate process optional
:type: bool
:return: Logout Request maybe deflated and base64 encoded
:rtype: str object

get_xml(self):

Returns the XML that will be sent as part of the request
or that was received at the SP
:return: XML request body
:rtype: string

get_id(request):

Returns the ID of the Logout Request
:param request: Logout Request Message
:type request: string|DOMDocument
:return: string ID
:rtype: str object

get_nameid_data(request, key=None):

Gets the NameID Data of the the Logout Request
:param request: Logout Request Message
:type request: string|DOMDocument
:param key: The SP key
:type key: string
:return: Name ID Data (Value, Format, NameQualifier, SPNameQualifier)
:rtype: dict

get_nameid(request, key=None):

Gets the NameID of the Logout Request Message
:param request: Logout Request Message
:type request: string|DOMDocument
:param key: The SP key
:type key: string
:return: Name ID Value
:rtype: string

get_nameid_format(request, key=None):

Gets the NameID Format of the Logout Request Message
:param request: Logout Request Message
:type request: string|DOMDocument
:param key: The SP key
:type key: string
:return: Name ID Format
:rtype: string

get_issuer(request):

Gets the Issuer of the Logout Request Message
:param request: Logout Request Message
:type request: string|DOMDocument
:return: The Issuer
:rtype: string

get_session_indexes(request):

Gets the SessionIndexes from the Logout Request
:param request: Logout Request Message
:type request: string|DOMDocument
:return: The SessionIndex value
:rtype: list

is_valid(self, request_data, raise_exceptions=False):

Checks if the Logout Request received is valid
:param request_data: Request Data
:type request_data: dict

:param raise_exceptions: Whether to return false on failure or raise an exception
:type raise_exceptions: Boolean

:return: If the Logout Request is or not valid
:rtype: boolean

get_error(self):

After executing a validation process, if it fails this method returns the cause

Source code