--- libauthcas-perl-1.5.orig/sampleCasClient.pl +++ libauthcas-perl-1.5/sampleCasClient.pl @@ -0,0 +1,111 @@ +#!/usr/bin/perl + +## Author Olivier Salaün +## Copyright Comité Réseau des Universités +## http://www.cru.fr + +## This is a sample CAS client +## You should add 3 ScriptAlias entries for it in your Apache conf file +## ScriptAlias /testproxy /var/www/cgi-bin/AuthCAS/sampleCasClient.pl +## ScriptAlias /testapp /var/www/cgi-bin/AuthCAS/sampleCasClient.pl +## +## This last alias should be set as HTTPS +## ScriptAlias /testcallback /var/www/cgi-bin/AuthCAS/sampleCasClient.pl + + +use AuthCAS; + +my $proxy_url = 'http://your.server/testproxy'; +my $proxy_callback_url = 'https://your.server/testcallback'; +my $app_url = 'http://your.server/testapp'; +my $cas_url = 'https://your.cas.server'; + +my $cas = new AuthCAS(casUrl => $cas_url, + CAFile => '/usr/local/apache/conf/ssl.crt/ca-bundle.crt', + ); + +if ($ENV{'SCRIPT_NAME'} eq '/testproxy') { + $cas->proxyMode(pgtFile => '/tmp/pgt.txt', + pgtCallbackUrl => $proxy_callback_url + ); + + unless ($ENV{'QUERY_STRING'} =~ /ticket=/) { + ## Redirect the User for login at CAS + ## This step is not required if we already have a PGT (Proxy Granting Ticket) + my $login_url = $cas->getServerLoginURL($proxy_url); + + printf "Location: $login_url\n\n"; + exit 0; + } + + my $ST; + + $ENV{'QUERY_STRING'} =~ /ticket=([^&]+)/; + $ST = $1; + + my $user = $cas->validateST($proxy_url, $ST); + + unless (defined $user) { + &error(&AuthCAS::get_errors); + exit 1; + } + + my $PT = $cas->retrievePT($app_url); + + my ($user2, @proxies) = $cas->validatePT($app_url, $PT); + + printf "Content-type: text/plain\n\nST: $ST\nUser: $user\nPT: $PT\nUser2 : $user2\nProxies : %s", join(',',@proxies); + + exit 0; +}elsif ($ENV{'SCRIPT_NAME'} eq '/testapp') { + unless ($ENV{'QUERY_STRING'} =~ /ticket=/) { + ## Redirect the User for login at CAS + ## This step is not required if we already have a PGT (Proxy Granting Ticket) + my $login_url = $cas->getServerLoginURL($app_url); + + printf "Location: $login_url\n\n"; + exit 0; + } + + my $ST; + + $ENV{'QUERY_STRING'} =~ /ticket=([^&]+)/; + $ST = $1; + + my $user = $cas->validateST($app_url, $ST); + + printf "Content-type: text/plain\n\nST: $ST\nUser: $user\n"; + + exit 0; +}elsif ($ENV{'SCRIPT_NAME'} eq '/testcallback') { + $cas->proxyMode(pgtFile => '/tmp/pgt.txt', + pgtCallbackUrl => $proxy_callback_url + ); + + $ENV{'QUERY_STRING'} =~ /^pgtIou=(\S+)&pgtId=(\S+)$/; + $cas->storePGT($1,$2); + print "Content-type: text/plain\n\n"; + dump_env(\*STDOUT); + exit 0; +}else { + print "Content-type: text/plain\n\n"; + &dump_env(\*STDOUT); +} + + +sub dump_env { + my $fd = shift; + + foreach my $k (keys %ENV) { + printf $fd "$k = $ENV{$k}\n"; + } +} + +sub error { + + print "Content-type: text/plain\n\n"; + printf "Erreur : %s\n", join('',@_); + + return 1; +} + --- libauthcas-perl-1.5.orig/debian/watch +++ libauthcas-perl-1.5/debian/watch @@ -0,0 +1,5 @@ +version=3 +http://sourcesup.cru.fr/frs/?group_id=76 \ + .*/AuthCAS-(.*)\.tar\.gz \ + debian \ + uupdate --- libauthcas-perl-1.5.orig/debian/examples +++ libauthcas-perl-1.5/debian/examples @@ -0,0 +1 @@ +sampleCasClient.pl --- libauthcas-perl-1.5.orig/debian/compat +++ libauthcas-perl-1.5/debian/compat @@ -0,0 +1 @@ +7 --- libauthcas-perl-1.5.orig/debian/rules +++ libauthcas-perl-1.5/debian/rules @@ -0,0 +1,67 @@ +#!/usr/bin/make -f +# This debian/rules file is provided as a template for normal perl +# packages. It was created by Marc Brockschmidt for +# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may +# be used freely wherever it is useful. +# +# It was later modified by Jason Kohles +# http://www.jasonkohles.com/ to support Module::Build installed modules + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# If set to a true value then MakeMaker's prompt function will +# always return the default without waiting for user input. +export PERL_MM_USE_DEFAULT=1 + +PACKAGE=$(shell dh_listpackages) + +ifndef PERL +PERL = /usr/bin/perl +endif + +TMP =$(CURDIR)/debian/$(PACKAGE) + +build: build-stamp +build-stamp: + dh_testdir + $(PERL) Build.PL installdirs=vendor + OPTIMIZE="-Wall -O2 -g" $(PERL) Build + touch build-stamp + +clean: + dh_testdir + dh_testroot + -$(PERL) Build distclean + dh_clean build-stamp install-stamp + +install: build install-stamp +install-stamp: + dh_testdir + dh_testroot + dh_prep + $(PERL) Build test + $(PERL) Build install destdir=$(TMP) + rm -fr $(TMP)/usr/lib/perl5/auto + touch install-stamp + +binary-arch: + +binary-indep: build install + dh_testdir + dh_testroot + dh_installexamples + dh_installdocs + dh_installchangelogs Changes + dh_perl + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary --- libauthcas-perl-1.5.orig/debian/control +++ libauthcas-perl-1.5/debian/control @@ -0,0 +1,21 @@ +Source: libauthcas-perl +Section: perl +Priority: optional +Build-Depends: debhelper (>= 7), libmodule-build-perl +Build-Depends-Indep: perl +Maintainer: CAS packaging team +Uploaders: Olivier Berger , Thijs Kinkhorst +Homepage: http://sourcesup.cru.fr/projects/perlcas/ +Standards-Version: 3.9.2 + +Package: libauthcas-perl +Architecture: all +Depends: ${perl:Depends}, ${misc:Depends}, libio-socket-ssl-perl, libwww-perl +Description: Client library for CAS 2.0 + JA-SIG Central Authentication Service (CAS) is a web authentication + and Single-Sign-On system. + . + This AuthCAS Perl module provides required subroutines to validate + and retrieve CAS tickets, allowing perl applications to become + clients of a CAS server. + --- libauthcas-perl-1.5.orig/debian/copyright +++ libauthcas-perl-1.5/debian/copyright @@ -0,0 +1,33 @@ +This package was initially debianized Lionel Porcheron + (using dh-make-perl). It was +updated later by Olivier Berger and +Thijs Kinkhorst . + +The original AuthCAS sources were downloaded from +http://sourcesup.cru.fr/projects/perlcas/ + +The file sampleCasClient.pl taken from upstream SVN was added to +/usr/share/doc/libauthcas-perl/examples/ to +provide an example on how to use this library. + +Upstream Author: + + Olivier Salaun + +Copyright: + + Copyright (C) 2005,2006,2007 Olivier Salaun - Comité Réseau des Universités + +License: + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself. + +Perl is distributed under your choice of the GNU General Public License or +the Artistic License. On Debian GNU/Linux systems, the complete text of the +GNU General Public License can be found in `/usr/share/common-licenses/GPL' +and the Artistic Licence in `/usr/share/common-licenses/Artistic'. + +The Debian packaging is Copyright (C) 2008, Olivier Berger +, 2011, Tilburg University and is licensed +under the GPL, see `/usr/share/common-licenses/GPL'. --- libauthcas-perl-1.5.orig/debian/changelog +++ libauthcas-perl-1.5/debian/changelog @@ -0,0 +1,14 @@ +libauthcas-perl (1.5-1) unstable; urgency=low + + * Update to 1.5 and first upload to unstable. + * Add self as uploader. + + -- Thijs Kinkhorst Tue, 17 May 2011 09:23:35 +0200 + +libauthcas-perl (1.3.1-1) unstable; urgency=low + + * Initial packaging, reusing the package made by Lionel Porcheron + (Closes: #494849). + + -- Olivier Berger Tue, 19 Aug 2008 17:03:58 +0200 +