Changeset 3775 for TI12-security/trunk/perl/ndglogin.pl
- Timestamp:
- 09/04/08 09:45:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/perl/ndglogin.pl
r3771 r3775 4 4 use warnings; 5 5 use CGI; 6 #use MIME::Base64::URLSafe;7 use ndgsecurity::ssoclient qw (urlSafeB64Encode);8 6 #use ndgsecurity::ssoclient; 7 use NDG::Security::Client; 8 9 9 my $cgi = CGI->new(); 10 10 #my $session = ndgsecurity::ssoclient->new($cgi); 11 my $session = eval {new ndgsecurity::ssoclient($cgi)};11 my $session = eval {new NDG::Security::Client($cgi)}; 12 12 13 $session->sessionHandler(); 14 my $wayfURI = "https://localhost/sso/wayf"; 15 16 # Refer back to THIS URL but over https rather than http 17 my $returnTo = "https://" . $cgi->virtual_host() . $cgi->url(-absolute=>1); 18 my $b64encReturnTo = "";#urlSafeB64Encode($returnTo); 19 20 print $cgi->header('text/html'); 21 print $cgi->start_html('NDG Login'), 22 $cgi->h1('NDG Login'), 23 $returnTo, $cgi->br, 24 $cgi->start_form(-action=>$wayfURI), 25 $cgi->hidden('r', $b64encReturnTo), $cgi->br, 26 $cgi->submit('NDG Login'), 27 $cgi->end_form, $cgi->p, 28 $cgi->hr; 29 30 print $cgi->end_html; 31 13 # Call Single Sign On handler 14 my $redirectHdr = $session->ssoHandler(); 15 if ($redirectHdr) 16 { 17 # A redirect header has created indicating the handler has received a response from 18 # a Single Sign Service 19 print $redirectHdr; 20 } 21 else 22 { 23 # Create a form based on the WAYF address and encoded return to address formulated by 24 # ssoHandler 25 print $cgi->header('text/html'); 26 print $cgi->start_html('NDG Login'), 27 $cgi->h1('NDG Login'), 28 $cgi->start_form(-action=>$session->{wayfURI}), 29 $cgi->hidden('r', $session->{b64encReturnToURL}), $cgi->br, 30 $cgi->submit('NDG Login'), 31 $cgi->end_form, $cgi->p, 32 $cgi->hr; 32 33 34 print $cgi->end_html; 35 } 36
Note: See TracChangeset
for help on using the changeset viewer.