Changeset 117
- Timestamp:
- 09/22/07 18:31:32
- Files:
-
- AuthKit/branches/0.4/CHANGELOG (modified) (1 diff)
- AuthKit/branches/0.4/authkit/authenticate/digest.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
AuthKit/branches/0.4/CHANGELOG
r78 r117 6 6 *** AS A RESULT OF THESE CHANGES THE DOCS ARE CURRENTLY OUT OF DATE *** 7 7 8 * Fixed the IE7 bug in digest middleware 8 9 * Adding SSO sub-directory, redirecting API, and CAS auth handler. 9 10 * Fixed binding check to return none, instead of throwing an Exception (for AuthKit/branches/0.4/authkit/authenticate/digest.py
r114 r117 49 49 AuthKitUserSetter, AuthKitAuthHandler 50 50 51 # Setting up logging 52 import logging 53 log = logging.getLogger('authkit.authenticate.digest') 54 55 51 56 def digest_password(realm, username, password): 52 57 """ construct the appropriate hashcode needed for HTTP digest """ … … 65 70 opaque = md5.md5("%s:%s" % (time.time(),random.random())).hexdigest() 66 71 self.nonce[nonce] = None 67 # XXX JG: I think adding '"auth"' here would fix the IE7 bug.68 72 parts = { 'realm': self.realm, 'qop': 'auth', 69 73 'nonce': nonce, 'opaque': opaque } … … 113 117 """ 114 118 if not authorization: 119 log.debug("No authorization specified: %s", authorization) 115 120 return self.build_authentication() 116 121 (authmeth, auth) = authorization.split(" ",1) 117 122 if 'digest' != authmeth.lower(): 123 log.debug("Method was not digest, it was: %s", authmeth.lower()) 118 124 return self.build_authentication() 119 125 amap = {} 120 for itm in auth.split(", "): 121 (k,v) = [s.strip() for s in itm.split("=",1)] 126 amap = {} 127 for itm in auth.split(","): 128 (k,v) = [s.strip() for s in itm.strip().split("=",1)] 122 129 amap[k] = v.replace('"','') 123 130 try: … … 136 143 assert nonce and nc 137 144 except: 145 log.debug("Couldn't authenticate. %s", sys.exc_info()[1]) 138 146 return self.build_authentication() 139 147 ha1 = self.authfunc(environ,realm,username) … … 202 210 return authenitcation.wsgi_application(environ, start_response) 203 211 else: 204 method = REQUEST_METHOD(environ) 205 fullpath = SCRIPT_NAME(environ) + PATH_INFO(environ) 206 authorization = AUTHORIZATION(environ) 207 result = self.authenticate(environ, authorization, fullpath, method) 208 return result.wsgi_application(environ, start_response) 209 212 raise Exception("Bug: Not called via the multihandler") 213 210 214 class DigestUserSetter(object): 211 215 def __init__(self, application, realm, authfunc, users):
