|
Lines 19-25
Link Here
|
| 19 |
|
19 |
|
| 20 |
=head1 DESCRIPTION |
20 |
=head1 DESCRIPTION |
| 21 |
|
21 |
|
| 22 |
# Here is an exemple of a CAS Proxy |
22 |
# Here is an example of a CAS Proxy |
| 23 |
# The proxy is a foreign application that will authenticate the user against CAS |
23 |
# The proxy is a foreign application that will authenticate the user against CAS |
| 24 |
# Once authenticated as a proxy, the foreign application will be able to call some |
24 |
# Once authenticated as a proxy, the foreign application will be able to call some |
| 25 |
# Koha webservices, proving authentication only by giving a proxy ticket |
25 |
# Koha webservices, proving authentication only by giving a proxy ticket |
|
Lines 58-71
if ($cgi->param('ticket')) {
Link Here
|
| 58 |
# We validate it against the CAS Server, providing the callback URL |
58 |
# We validate it against the CAS Server, providing the callback URL |
| 59 |
my $r = $cas->service_validate( $proxy_service, $cgi->param('ticket'), pgtUrl => $pgtUrl); |
59 |
my $r = $cas->service_validate( $proxy_service, $cgi->param('ticket'), pgtUrl => $pgtUrl); |
| 60 |
|
60 |
|
| 61 |
# If it is sucessful, we are authenticated |
61 |
# If it is successful, we are authenticated |
| 62 |
if( $r->is_success() ) { |
62 |
if( $r->is_success() ) { |
| 63 |
print "User authenticated as: ", $r->user(), "<br>\n"; |
63 |
print "User authenticated as: ", $r->user(), "<br>\n"; |
| 64 |
} else { |
64 |
} else { |
| 65 |
print "User authentication failed<br />\n"; |
65 |
print "User authentication failed<br />\n"; |
| 66 |
} |
66 |
} |
| 67 |
|
67 |
|
| 68 |
# If we have a PGTIou ticket, the proxy validation was sucessful |
68 |
# If we have a PGTIou ticket, the proxy validation was successful |
| 69 |
if (defined $r->iou) { |
69 |
if (defined $r->iou) { |
| 70 |
print "Proxy granting ticket IOU: ", $r->iou, "<br />\n"; |
70 |
print "Proxy granting ticket IOU: ", $r->iou, "<br />\n"; |
| 71 |
my $pgtIou = $r->iou; |
71 |
my $pgtIou = $r->iou; |