Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/perl/ndglogin.pl@3771
Revision 3771,
812 bytes
checked in by pjkersha, 13 years ago
(diff) |
Perl version of NDG Security Single Sign On Client. Retruns from WAYF
and login + sets encrypted cookie. More work to do handle redirect
https->http.
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!/usr/bin/env perl |
---|
2 | |
---|
3 | use strict; |
---|
4 | use warnings; |
---|
5 | use CGI; |
---|
6 | #use MIME::Base64::URLSafe; |
---|
7 | use ndgsecurity::ssoclient qw (urlSafeB64Encode); |
---|
8 | |
---|
9 | my $cgi = CGI->new(); |
---|
10 | #my $session = ndgsecurity::ssoclient->new($cgi); |
---|
11 | my $session = eval {new ndgsecurity::ssoclient($cgi)}; |
---|
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 | |
---|
32 | |
---|
Note: See
TracBrowser
for help on using the repository browser.