def setup_pau(pau): ''' Callback to setup the Pluggable Authentication Utility A reference to this function is passed as a parameter in the declaration of the PAU (see PlainLoginDemo class) ''' # the principal source is a PrincipalFolder, stored in ZODB pau['principals'] = PrincipalFolder() pau.authenticatorPlugins = ('principals', ) # the SessionCredentialsPlugin isused for cookie-based authentication pau['session'] = session = SessionCredentialsPlugin() session.loginpagename = 'login' # the page to redirect for login # configuration of the credentials plugin pau.credentialsPlugins = ( 'No Challenge if Authenticated', 'session', )
def test_logout(self): plugin = SessionCredentialsPlugin() self.assertEqual(plugin.logout(base.TestRequest('/')), False)
def test_challenge(self): plugin = SessionCredentialsPlugin() self.assertEqual(plugin.challenge(base.TestRequest('/')), False)
def test_exeractCredentials(self): plugin = SessionCredentialsPlugin() self.assertEqual(plugin.extractCredentials(base.TestRequest('/')), None)