auth: remove obsolete definistions
This commit is contained in:
parent
636b209e9a
commit
77fedaaeaa
2 changed files with 1 additions and 24 deletions
|
@ -11,33 +11,11 @@ from zope.publisher.interfaces.browser import IBrowserRequest, IBrowserPage
|
||||||
from zope.publisher.browser import BrowserPage
|
from zope.publisher.browser import BrowserPage
|
||||||
from zope.security.proxy import removeSecurityProxy
|
from zope.security.proxy import removeSecurityProxy
|
||||||
|
|
||||||
def registerAuthentication(config):
|
|
||||||
registerAuthUtility(config)
|
|
||||||
#registerAuthViews(config)
|
|
||||||
|
|
||||||
def registerAuthUtility(config):
|
def registerAuthUtility(config):
|
||||||
baseAuth = getUtility(IAuthentication)
|
baseAuth = getUtility(IAuthentication)
|
||||||
print('*** registerAuthUtility, baseAuth:', baseAuth)
|
print('*** registerAuthUtility, baseAuth:', baseAuth)
|
||||||
provideUtility(auth.OidcAuthentication(baseAuth))
|
provideUtility(auth.OidcAuthentication(baseAuth))
|
||||||
|
|
||||||
def registerAuthViews(config):
|
|
||||||
provideAdapter(LoginView, (Interface, IBrowserRequest), IBrowserPage,
|
|
||||||
name='auth_login')
|
|
||||||
provideAdapter(callback, (Interface, IBrowserRequest), IBrowserPage,
|
|
||||||
name='auth_callback')
|
|
||||||
|
|
||||||
@implementer(IBrowserPage)
|
|
||||||
def login(context, request):
|
|
||||||
removeSecurityProxy(context)
|
|
||||||
auth.Authenticator(request).login()
|
|
||||||
return context
|
|
||||||
|
|
||||||
@implementer(IBrowserPage)
|
|
||||||
def callback(context, request):
|
|
||||||
removeSecurityProxy(context)
|
|
||||||
auth.Authenticator(request).callback()
|
|
||||||
return DummyView(context, request)
|
|
||||||
|
|
||||||
|
|
||||||
class LoginView:
|
class LoginView:
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,7 @@ def main():
|
||||||
zope_conf = getattr(config, 'zope_conf', 'zope.conf')
|
zope_conf = getattr(config, 'zope_conf', 'zope.conf')
|
||||||
print(f'starting loops server... - conf: {zope_conf}')
|
print(f'starting loops server... - conf: {zope_conf}')
|
||||||
app = getWSGIApplication(zope_conf)
|
app = getWSGIApplication(zope_conf)
|
||||||
#auth.registerAuthUtility(config)
|
auth.registerAuthUtility(config)
|
||||||
auth.registerAuthentication(config)
|
|
||||||
run(app, config)
|
run(app, config)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Add table
Reference in a new issue