Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
PluggableAuthService.plugins.SessionAuthHelper.SessionAuthHelper Class Reference
Inheritance diagram for PluggableAuthService.plugins.SessionAuthHelper.SessionAuthHelper:
Inheritance graph
[legend]
Collaboration diagram for PluggableAuthService.plugins.SessionAuthHelper.SessionAuthHelper:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def extractCredentials
def updateCredentials
def resetCredentials

Public Attributes

 title

Static Public Attributes

string meta_type = 'Session Auth Helper'
tuple security = ClassSecurityInfo()

Detailed Description

Multi-plugin for managing details of Session Authentication. 

Definition at line 57 of file SessionAuthHelper.py.


Constructor & Destructor Documentation

Definition at line 63 of file SessionAuthHelper.py.

00063 
00064     def __init__(self, id, title=None):
00065         self._setId(id)
00066         self.title = title

Here is the call graph for this function:


Member Function Documentation

Extract basic auth credentials from 'request'. 

Definition at line 68 of file SessionAuthHelper.py.

00068 
00069     def extractCredentials(self, request):
00070         """ Extract basic auth credentials from 'request'. """
00071         creds = {}
00072 
00073         # Looking into the session first...
00074         name = request.SESSION.get('__ac_name', '')
00075         password = request.SESSION.get('__ac_password', '')
00076 
00077         if name:
00078             creds[ 'login' ] = name
00079             creds[ 'password' ] = password
00080         else:
00081             # Look into the request now
00082             login_pw = request._authUserPW()
00083 
00084             if login_pw is not None:
00085                 name, password = login_pw
00086                 creds[ 'login' ] = name
00087                 creds[ 'password' ] = password
00088                 request.SESSION.set('__ac_name', name)
00089                 request.SESSION.set('__ac_password', password)
00090 
00091         if creds:
00092             creds['remote_host'] = request.get('REMOTE_HOST', '')
00093 
00094             try:
00095                 creds['remote_address'] = request.getClientAddr()
00096             except AttributeError:
00097                 creds['remote_address'] = request.get('REMOTE_ADDR', '')
00098 
00099         return creds

Empty out the currently-stored session values 

Definition at line 107 of file SessionAuthHelper.py.

00107 
00108     def resetCredentials(self, request, response):
00109         """ Empty out the currently-stored session values """
00110         request.SESSION.set('__ac_name', '')
00111         request.SESSION.set('__ac_password', '')
00112 
00113 classImplements( SessionAuthHelper
00114                , ISessionAuthHelper
00115                , ILoginPasswordHostExtractionPlugin
00116                , ICredentialsUpdatePlugin
00117                , ICredentialsResetPlugin
00118                )
00119 
00120 InitializeClass(SessionAuthHelper)
00121 

Here is the call graph for this function:

def PluggableAuthService.plugins.SessionAuthHelper.SessionAuthHelper.updateCredentials (   self,
  request,
  response,
  login,
  new_password 
)
Respond to change of credentials. 

Definition at line 101 of file SessionAuthHelper.py.

00101 
00102     def updateCredentials(self, request, response, login, new_password):
00103         """ Respond to change of credentials. """
00104         request.SESSION.set('__ac_name', login)
00105         request.SESSION.set('__ac_password', new_password)


Member Data Documentation

Definition at line 59 of file SessionAuthHelper.py.

Definition at line 60 of file SessionAuthHelper.py.

Definition at line 65 of file SessionAuthHelper.py.


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