Ignore:
Timestamp:
31/07/06 14:06:58 (14 years ago)
Author:
pjkersha
Message:

Working version of SecurityCGI with split ServiceProviderSecurityCGI and IdentityProviderSecurityCGI classes.

Tests/SecurityCGItest.py: added test for IdentityProviderSecurityCGI._returnCredsResponse()

www/cgi-bin/idp.py: call without named local var for IdPcgi?.

www/cgi-bin/sp.py: showCredsReceived renamed -> onCredsSet; fized returnURI link path.

NDG/SecurityCGI.py:

  • processFields - made lambdas for more complicated if conditions. Added extra case for where a cookie is

already present in the environment

  • showIdPsiteSelect - added bodyTxt keyword
  • showCredsReceived renamed onCredsSet - it's now called when a new cookie has been created from credentials

returned from IdP and also, if a security cookie already exists.

NDG/Session.py: fixed bug in UserSession?.createSecurityCookie - missed out 'raise' in no expiry time set error
block.

Location:
TI12-security/trunk/python/www/cgi-bin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/www/cgi-bin/idp.py

    r1340 r1343  
    3434    clntPriKeyFilePath = "../certs/GabrielCGI-key.pem" 
    3535 
    36     idpCGI = IdPcgi(os.path.basename(__file__), 
    37                     smWSDLuri, 
    38                     smPubKeyFilePath=smPubKeyFilePath, 
    39                     clntPubKeyFilePath=clntPubKeyFilePath, 
    40                     clntPriKeyFilePath=clntPriKeyFilePath) 
    41     idpCGI() 
     36    IdPcgi(os.path.basename(__file__), 
     37           smWSDLuri, 
     38           smPubKeyFilePath=smPubKeyFilePath, 
     39           clntPubKeyFilePath=clntPubKeyFilePath, 
     40           clntPriKeyFilePath=clntPriKeyFilePath)() 
  • TI12-security/trunk/python/www/cgi-bin/sp.py

    r1340 r1343  
    2929 
    3030    #_________________________________________________________________________ 
    31     def showCredsReceived(self, 
    32                               sessCookie, 
    33                                                   pageTitle='Credentials returned from IdP', 
    34                           bodyTxt='New Cookie set from credentials'): 
    35         """Called from receiveCredsResponse() once a cookie has been created. 
    36         Makes a page to set the cookie and display to the user that they have 
    37         been authenticated.  Derived class should override this method as 
    38         required""" 
    39         super(SPcgi, self).showCredsReceived(sessCookie, 
    40                                              pageTitle=pageTitle, 
    41                                              bodyTxt=bodyTxt) 
     31    def onCredsSet(self, 
     32                   sessCookie=None, 
     33                                   pageTitle='Credentials returned from IdP', 
     34                   bodyTxt='<h2>NDG Security Cookie is present</h2>'): 
     35         
     36        super(SPcgi, self).onCredsSet(sessCookie=sessCookie, 
     37                                      pageTitle=pageTitle, 
     38                                      bodyTxt=bodyTxt) 
    4239 
    4340 
     
    4542if __name__ == "__main__": 
    4643 
    47     returnURI = 'https://gabriel.bnsc.rl.ac.uk/sp.py' 
     44    returnURI = 'https://gabriel.bnsc.rl.ac.uk/cgi-bin/sp.py' 
    4845    aaWSDL = 'http://gabriel.bnsc.rl.ac.uk/attAuthority.wsdl' 
    4946    aaPubKeyFilePath = "/usr/local/NDG/conf/certs/gabriel-aa-cert.pem" 
     
    5249    clntPriKeyFilePath = "../certs/GabrielCGI-key.pem" 
    5350 
    54     spCGI = SPcgi(os.path.basename(__file__), 
    55                   returnURI, 
    56                   aaWSDL, 
    57                   aaPubKeyFilePath=aaPubKeyFilePath, 
    58                   clntPubKeyFilePath=clntPubKeyFilePath, 
    59                   clntPriKeyFilePath=clntPriKeyFilePath) 
    60     spCGI() 
     51    SPcgi(os.path.basename(__file__), 
     52          returnURI, 
     53          aaWSDL, 
     54          aaPubKeyFilePath=aaPubKeyFilePath, 
     55          clntPubKeyFilePath=clntPubKeyFilePath, 
     56          clntPriKeyFilePath=clntPriKeyFilePath)() 
     57 
Note: See TracChangeset for help on using the changeset viewer.