Changeset 6440 for TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/authn.py
- Timestamp:
- 29/01/10 14:07:36 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/wsgi/authn.py
r6264 r6440 30 30 SessionHandlerMiddleware) 31 31 32 from ndg.security.server.wsgi.ssl import AuthKitSSLAuthnMiddleware 32 33 33 34 class AuthnException(NDGSecurityMiddlewareError): … … 51 52 '''HTTP Basic Authentication Middleware 52 53 ''' 53 54 54 AUTHN_FUNC_ENV_KEYNAME = ('ndg.security.server.wsgi.authn.' 55 55 'HTTPBasicAuthMiddleware.authenticate') … … 280 280 quotedReturn2URI = urllib.quote(return2URI, safe='') 281 281 return2URIQueryArg = urllib.urlencode( 282 283 282 {AuthnRedirectInitiatorMiddleware.RETURN2URI_ARGNAME: 283 quotedReturn2URI}) 284 284 285 285 redirectURI = self.redirectURI … … 306 306 """ 307 307 if status.startswith(cls.TRIGGER_HTTP_STATUS_CODE): 308 log.debug("%s.checker caught status [%s]: invoking authentication "309 " 308 log.debug("%s.checker caught status [%s]: invoking authentication " 309 "handler", cls.__name__, cls.TRIGGER_HTTP_STATUS_CODE) 310 310 return True 311 311 else: … … 326 326 which performs a similar function. 327 327 """ 328 328 329 @NDGSecurityMiddlewareBase.initCall 329 330 def __call__(self, environ, start_response): … … 345 346 346 347 # Check for a return URI setting in the beaker session and if the user 347 # is authenticated, redirect to this URL deleting the beaker session 348 # has just been authenticated by the AuthKit SSL Client authentication 349 # middleware. If so, redirect to this URL deleting the beaker session 348 350 # URL setting 349 351 return2URI = session.get(self.__class__.RETURN2URI_ARGNAME) 350 if self. isAuthenticated and return2URI:352 if self.sslAuthnSucceeded and return2URI: 351 353 del session[self.__class__.RETURN2URI_ARGNAME] 352 354 session.save() … … 366 368 doc="Boolean indicating if AuthKit " 367 369 "'REMOTE_USER' environment variable is set") 370 371 _sslAuthnSucceeded = lambda self: self.environ.get( 372 AuthKitSSLAuthnMiddleware.AUTHN_SUCCEEDED_ENVIRON_KEYNAME, 373 False) 374 375 sslAuthnSucceeded = property(fget=_sslAuthnSucceeded, 376 doc="Boolean indicating SSL authentication " 377 "has succeeded in " 378 "AuthKitSSLAuthnMiddleware upstream of " 379 "this middleware") 380 368 381 def __init__(self, app, app_conf, **local_conf): 369 382 super(AuthKitRedirectResponseMiddleware, self).__init__(app, app_conf,
Note: See TracChangeset
for help on using the changeset viewer.