Ignore:
Timestamp:
25/09/09 17:02:25 (10 years ago)
Author:
pjkersha
Message:

Adding SSL Client authentication step into authz_lite integration test. Broken redirecting back from authn step to requested resource.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg_security_server/ndg/security/server/wsgi/authn.py

    r5766 r5770  
    5555    return to URI between initiator and consumer classes""" 
    5656    RETURN2URI_ARGNAME = 'ndg.security.r' 
    57 #     
    58 #    _isAuthenticated = lambda self: \ 
    59 #            AuthnRedirectMiddleware.USERNAME_ENVIRON_KEYNAME in self.environ 
    60 #             
    61 #    isAuthenticated = property(fget=_isAuthenticated, 
    62 #                               doc='boolean for, "is user logged in?"') 
     57 
    6358 
    6459class AuthnRedirectInitiatorMiddleware(AuthnRedirectMiddleware): 
     
    192187            params = {} 
    193188         
     189        # Store the return URI query argument in a beaker session 
    194190        quotedReferrer = params.get(self.__class__.RETURN2URI_ARGNAME, '') 
    195191        referrerURI = urllib.unquote(quotedReferrer) 
     
    198194            session.save() 
    199195             
     196        # Check for a return URI setting in the beaker session and if the user 
     197        # is authenticated, redirect to this URL deleting the beaker session 
     198        # URL setting 
    200199        return2URI = session.get(self.__class__.RETURN2URI_ARGNAME)     
    201200        if self.isAuthenticated and return2URI: 
     
    207206 
    208207 
     208class AuthKitRedirectResponseMiddleware(AuthnRedirectResponseMiddleware): 
     209    """Overload isAuthenticated method in parent class to set Authenticated  
     210    state based on presence of AuthKit 'REMOTE_USER' environ variable 
     211    """ 
     212    _isAuthenticated = lambda self: \ 
     213        AuthnRedirectResponseMiddleware.USERNAME_ENVIRON_KEYNAME in self.environ 
     214         
     215    isAuthenticated = property(fget=_isAuthenticated, 
     216                               doc="Boolean indicating if AuthKit " 
     217                                   "'REMOTE_USER' environment variable is set") 
     218    def __init__(self, app, app_conf, **local_conf): 
     219        super(AuthKitRedirectResponseMiddleware, self).__init__(app, app_conf, 
     220                                                                **local_conf) 
     221    @NDGSecurityMiddlewareBase.initCall 
     222    def __call__(self, environ, start_response): 
     223        return super(AuthKitRedirectResponseMiddleware, self).__call__(environ, 
     224                                                                start_response) 
     225        
     226         
    209227class SessionHandlerMiddlewareConfigError(Exception): 
    210228    """Configuration errors from SessionHandlerMiddleware""" 
Note: See TracChangeset for help on using the changeset viewer.