Example #1
0
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',
    )
Example #2
0
    def test_logout(self):
        plugin = SessionCredentialsPlugin()

        self.assertEqual(plugin.logout(base.TestRequest('/')), False)
Example #3
0
    def test_challenge(self):
        plugin = SessionCredentialsPlugin()

        self.assertEqual(plugin.challenge(base.TestRequest('/')), False)
Example #4
0
    def test_exeractCredentials(self):
        plugin = SessionCredentialsPlugin()

        self.assertEqual(plugin.extractCredentials(base.TestRequest('/')),
                         None)
Example #5
0
    def test_logout(self):
        plugin = SessionCredentialsPlugin()

        self.assertEqual(plugin.logout(base.TestRequest('/')), False)
Example #6
0
    def test_challenge(self):
        plugin = SessionCredentialsPlugin()

        self.assertEqual(plugin.challenge(base.TestRequest('/')), False)
Example #7
0
    def test_exeractCredentials(self):
        plugin = SessionCredentialsPlugin()

        self.assertEqual(plugin.extractCredentials(base.TestRequest('/')), None)