source: TI12-security/trunk/python/ndg.security.server/ndg/security/server/sso/sso/controllers/wayf.py @ 3918

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.server/ndg/security/server/sso/sso/controllers/wayf.py@3918
Revision 3918, 1.0 KB checked in by pjkersha, 12 years ago (diff)

Initial Integration of Single Sign On Service with OpenID and Pylons AuthKit?:

  • WAYF now contains an OpenID textbox for sign in
  • No role integration carried out yet - OpenID has no better privileges than an anonymous user(!)
  • Integrated into Authkit - requires lots of config settings in pylons ini file
  • HTTP 401 error get redirected automatically to WAYF
  • Need to create an AuthKit? egg from SVN 151 checkout - will put on NDG dist
Line 
1import logging
2
3from ndg.security.server.sso.sso.lib.base import *
4from ndg.security.common.AttAuthority import AttAuthorityClient
5from base64 import urlsafe_b64decode
6
7log = logging.getLogger(__name__)
8
9
10class WayfController(BaseController):
11    """Where Are You From Controller - display a list of trusted sites for
12    login"""
13
14    def index(self):
15        ''' NDG equivalent to Shibboleth WAYF '''
16       
17        # Check for return to arg in query.  This is necessary only if the
18        # WAYF query originates from a different service to this one
19        if 'r' in request.params:
20            # Convenience alias
21            state = g.ndg.security.common.sso.state
22       
23            state.b64encReturnToURL = str(request.params['r'])
24            state.returnToURL = urlsafe_b64decode(str(state.b64encReturnToURL)) 
25            log.debug("Set return to URL from 'r' query arg: r = %s"% \
26                                                        state.returnToURL)
27
28        # Trigger AuthKit handler:
29        abort(401)
Note: See TracBrowser for help on using the repository browser.