THIS DOCUMENTATION IS OBSOLETE

PLEASE VISIT: http://cern.ch/linux/docs/cernssocookie.shtml FOR UP TO DATE DOCUMENTATION

Accessing CERN SSO protected pages using command line clients

Using Kerberos credentials

Download perl module: WWWCERNSSOKrb5.pm

Make sure you have valid kerberos ticket

example 1: HTTP GET

#!/usr/bin/perl
#use WWW::CERNSSO::Krb5;
require 'WWWCERNSSOKrb5.pm';
use Data::Dumper;

my $wget = WWW::CERNSSO::Krb5->new();
my $out = $wget->curl('https://shib2.cern.ch/SSO/');

print Dumper($out);

example 2: HTTP POST

#!/usr/bin/perl
#use WWW::CERNSSO::Krb5;
require 'WWWCERNSSOKrb5.pm';
use Data::Dumper;

my $wget = WWW::CERNSSO::Krb5->new();

my %form = ( 'field1' => 'value1', 'field2' => 'value2');

my $out = $wget->curl('https://shib2.cern.ch/SSO/',%form);

print Dumper($out);

example 3: get cookies to reuse with different tool

#!/usr/bin/perl
#use WWW::CERNSSO::Krb5;
require 'WWWCERNSSOKrb5.pm';
my $wget = WWW::CERNSSO::Krb5->new('mycookiefile.txt');
my $out = $wget->curl('https://shib2.cern.ch/SSO/');

and:

wget (--no-check-certificate) --load-cookies mycookiefile.txt https://shib2.cern.ch/SSO

WARNING: store mycookiefile.txt in safe (non public readable!) place .

-- JaroslawPolok - 07-Jun-2012

Topic attachments
I Attachment History Action Size Date Who Comment
Perl source code filepm WWWCERNSSOKrb5.pm r1 manage 7.6 K 2012-06-07 - 15:08 JaroslawPolok  
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2012-07-20 - JaroslawPolok
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LinuxSupport All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback