source: TI12-security/trunk/python/www/cgi-bin/sp.py @ 1340

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/www/cgi-bin/sp.py@1340
Revision 1340, 2.2 KB checked in by pjkersha, 14 years ago (diff)

Tests/SecurityCGItest: ServiceProviderSecurityCGI now takes returnURI arg. showHomeSiteSelect renamed ->
testSPshowIdPsiteSelect.

NDG/AttAuthorityIO, NDG/SessionMgrIO, NDG/SecurityCGI.py, www/cgi-bin/idp.py and cgi-bin/sp.py:

  • fix to major bug - calls to super should give class name explicitly and not self.class otherwise

derived classes will pick up the wrong super class.

NDG/SecurityCGI.py: major fixes and improvements; bug still exists with _returnCredsResponse

NDG/Session.py: fix call to createSecurityCookie call.

  • Property svn:executable set to *
Line 
1#!/usr/local/NDG/ActivePython-2.4/bin/python
2
3"""Example NDG Security CGI Service Provider Id Request Service
4
5NERC Data Grid Project
6
7P J Kershaw 27/07/06
8
9Copyright (C) 2006 CCLRC & NERC
10
11This software may be distributed under the terms of the Q Public License,
12version 1.0 or later.
13"""
14import os
15from NDG.SecurityCGI import ServiceProviderSecurityCGI, SecurityCGIError
16
17
18class SPcgi(ServiceProviderSecurityCGI):
19    """CGI interface test class for NDG Security Service Provider requesting
20    user ID from an NDG Identity Provider"""
21
22    #_________________________________________________________________________
23    def showIdPsiteSelect(self, 
24               pageTitle='Select your home site to retrieve your credentials',
25               **kwargs):
26
27        super(SPcgi, self).showIdPsiteSelect(pageTitle=pageTitle, **kwargs)
28
29
30    #_________________________________________________________________________
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)
42
43
44#_____________________________________________________________________________
45if __name__ == "__main__":
46
47    returnURI = 'https://gabriel.bnsc.rl.ac.uk/sp.py'
48    aaWSDL = 'http://gabriel.bnsc.rl.ac.uk/attAuthority.wsdl'
49    aaPubKeyFilePath = "/usr/local/NDG/conf/certs/gabriel-aa-cert.pem"
50
51    clntPubKeyFilePath = "../certs/GabrielCGI-cert.pem"
52    clntPriKeyFilePath = "../certs/GabrielCGI-key.pem"
53
54    spCGI = SPcgi(os.path.basename(__file__),
55                  returnURI,
56                  aaWSDL,
57                  aaPubKeyFilePath=aaPubKeyFilePath,
58                  clntPubKeyFilePath=clntPubKeyFilePath,
59                  clntPriKeyFilePath=clntPriKeyFilePath)
60    spCGI()
Note: See TracBrowser for help on using the repository browser.