source: TI12-security/trunk/perl/ndglogin.pl @ 3771

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, 12 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
3use strict;
4use warnings;
5use CGI;
6#use MIME::Base64::URLSafe;
7use ndgsecurity::ssoclient qw (urlSafeB64Encode);
8 
9my $cgi = CGI->new();
10#my $session = ndgsecurity::ssoclient->new($cgi);
11my $session = eval {new ndgsecurity::ssoclient($cgi)};
12
13$session->sessionHandler();
14my $wayfURI = "https://localhost/sso/wayf";
15
16# Refer back to THIS URL but over https rather than http
17my $returnTo = "https://" . $cgi->virtual_host() . $cgi->url(-absolute=>1);
18my $b64encReturnTo = "";#urlSafeB64Encode($returnTo);
19
20print $cgi->header('text/html');
21print $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
30print $cgi->end_html;
31
32   
Note: See TracBrowser for help on using the repository browser.