ShibbolethSupport

Add Shibboleth based Single Sign-On authentication support for moinmoin logins .

Authentication support

strict session support

lazy session support

I have written a basic Shibboleth auth module with lazy authentication (users need to click the Login link):

from MoinMoin.auth import ContinueLogin, MultistageRedirectLogin
from MoinMoin.auth.http import HTTPAuth

class ShibbolethAuth(HTTPAuth):
    """ Authenticate with Shibboleth """
    name = 'shibboleth'
    login_inputs = ['special_no_input']

    def request(self, request, user_obj, **kw):
        try:
            # hack to make HTTPAuth work with Shibboleth                        
            if request.env.get('REMOTE_USER'):
                request.env['AUTH_TYPE'] = 'Basic'
        except AttributeError:
            pass
        return HTTPAuth.request(self, request, user_obj, **kw)

    def login(self, request, user_obj, **kw):
        if kw.get('multistage'):
            u, cont = self.request(request, user_obj, **kw)
            return ContinueLogin(u)
        else:
            shiburl = request.getQualifiedURL('/Shibboleth.sso/Login')
            return MultistageRedirectLogin(shiburl + '?target=%return')

I have tested it with MoinMoin 1.7.1. Simply paste it into your configuration file (or in a separate file and import it). It also works with non-lazy (strict) authentication.

Bug: You always get redirected to the front page after login.

I'm not experienced with Python or the MoinMoin codebase, so any suggestions are welcome. --PerOlofsson

Authorisation support

Discussion

So, to summarize, we need auth method '' for shibboleth v1 and 'shibboleth' for v2? And that's all we need to do on the moin side to start with basic support for it? Or do we need to wait for more code first?


CategoryFeatureRequest

MoinMoin: ShibbolethSupport (last edited 2011-05-06 14:59:46 by PerOlofsson)