I've been attempting to develop a SAML solution for our old-Zope 2.10 off and on since September. I've been grateful for the help I've been given throughout this process.
There are complications preventing us from upgrading to Zope 2.12 or 2.13, and I've been unable to get dm.zope.saml2 installed. The advice given back in September was to use the Apache mod_auth_mellon module to perform the SAML SP duties, then write a PAS plugin. check, and check
It was an adventure even getting my plugin to show up in the Add-list, but it is there now, thankfully.
My issue is Mellon unpacks all the SAML Attributes from the SAML token into the environment, but Zope seems to clobber the environment before my plugin even runs.
If I do not start Zope and instead run a simple Apache website, I can run a simple WSGI application and grab the SAML attributes out of the environment like this:
from webob import dec, Response
@dec.wsgify
def application(req):
user = {'uid': '', 'role': '', 'phone': '', 'lastName': '', 'firstName': ''}
user['uid'] = req.environ['MELLON_urn:oid:0.9.2342.19200300.100.1.1']
user['role'] = req.environ['MELLON_https://samltest.id/attributes/role']
user['phone'] = req.environ['MELLON_urn:oid:2.5.4.20']
user['lastName'] = req.environ['MELLON_urn:oid:2.5.4.4']
user['firstName'] = req.environ['MELLON_urn:oid:2.5.4.42']
#return Response(pprint.pformat(req.environ), content_type='application/json')
return Response(pprint.pformat(user), content_type='application/json')
The Zope we run is Zope 2.10.6, but it appears it was originally installed using the Plone 3.1.1 universal installer. But, we do not run a Plone-site, we run Zope.
Is there a way to get the environment into PAS? I've tried having my plugin implement zope.publisher.interfaces.http.IHTTPApplicationRequest
, but when my plugin runs, it simply ignores any code using that interface. I have 3 logging statements in my authenticateCredentials
function, and only one of those statements logs anything.