Ignore:
Timestamp:
02/03/09 16:28:19 (11 years ago)
Author:
pjkersha
Message:

Tested WS-Security SignatureHandler? based on the 4Suite-XML Canonicalizer. - Tested a client connecting to a server using the old dom based implementation of the SignatureHandler?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/wsgi/openid/relyingparty/__init__.py

    r5042 r5057  
    138138        referrer = urllib.unquote(quotedReferrer) 
    139139        referrerPathInfo = urlsplit(referrer)[2] 
     140 
    140141        if referrer and \ 
    141142           not referrerPathInfo.endswith(self._authKitVerifyPath) and \ 
     
    181182                environ['HTTP_REFERER'] 
    182183            session.save() 
    183              
    184         def set401UnauthorizedReponse(status, header, exc_info=None): 
    185             '''Make OpenID Relying Party OpenID prompt page return a 401 
    186             status to signal to non-browser based clients that authentication 
    187             is required.  Requests are filtered on content type so that  
    188             static content such as graphics and style sheets associated with 
    189             the page are let through unaltered 
    190              
    191             @type status: str 
    192             @param status: HTTP status code and status message 
    193             @type header: list 
    194             @param header: list of field, value tuple HTTP header content 
    195             @type exc_info: Exception 
    196             @param exc_info: exception info 
    197             ''' 
    198             _status = status 
    199             for name, val in header: 
    200                 if name.lower() == 'content-type' and \ 
    201                    val.startswith('text/html'): 
    202                     _status = self.getStatusMessage(401) 
    203                     break 
    204                  
    205             return start_response(_status, header, exc_info) 
    206  
    207         return self._app(environ, set401UnauthorizedReponse) 
     184         
     185        # See _start_response doc for an explanation... 
     186        if environ['PATH_INFO'] == self._authKitVerifyPath:  
     187            def _start_response(status, header, exc_info=None): 
     188                '''Make OpenID Relying Party OpenID prompt page return a 401 
     189                status to signal to non-browser based clients that  
     190                authentication is required.  Requests are filtered on content  
     191                type so that static content such as graphics and style sheets  
     192                associated with the page are let through unaltered 
     193                 
     194                @type status: str 
     195                @param status: HTTP status code and status message 
     196                @type header: list 
     197                @param header: list of field, value tuple HTTP header content 
     198                @type exc_info: Exception 
     199                @param exc_info: exception info 
     200                ''' 
     201                _status = status 
     202                for name, val in header: 
     203                    if name.lower() == 'content-type' and \ 
     204                       val.startswith('text/html'): 
     205                        _status = self.getStatusMessage(401) 
     206                        break 
     207                     
     208                return start_response(_status, header, exc_info) 
     209        else: 
     210            _start_response = start_response 
     211 
     212        return self._app(environ, _start_response) 
    208213 
    209214     
Note: See TracChangeset for help on using the changeset viewer.