示例#1
0
文件: app.py 项目: bendavis78/zope
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',
    )
示例#2
0
文件: tests.py 项目: bendavis78/zope
    def test_logout(self):
        plugin = SessionCredentialsPlugin()

        self.assertEqual(plugin.logout(base.TestRequest('/')), False)
示例#3
0
文件: tests.py 项目: bendavis78/zope
    def test_challenge(self):
        plugin = SessionCredentialsPlugin()

        self.assertEqual(plugin.challenge(base.TestRequest('/')), False)
示例#4
0
文件: tests.py 项目: bendavis78/zope
    def test_exeractCredentials(self):
        plugin = SessionCredentialsPlugin()

        self.assertEqual(plugin.extractCredentials(base.TestRequest('/')),
                         None)
示例#5
0
文件: tests.py 项目: wpjunior/proled
    def test_logout(self):
        plugin = SessionCredentialsPlugin()

        self.assertEqual(plugin.logout(base.TestRequest('/')), False)
示例#6
0
文件: tests.py 项目: wpjunior/proled
    def test_challenge(self):
        plugin = SessionCredentialsPlugin()

        self.assertEqual(plugin.challenge(base.TestRequest('/')), False)
示例#7
0
文件: tests.py 项目: wpjunior/proled
    def test_exeractCredentials(self):
        plugin = SessionCredentialsPlugin()

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