Bugzilla – Attachment 62521 Details for
Bug 12026
Shibboleth auto-provisioning - Create
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
BUG 12027: Added shibboleth authentication to the staff client
BUG-12027-Added-shibboleth-authentication-to-the-s.patch (text/plain), 4.17 KB, created by
Martin Renvoize (ashimema)
on 2017-04-21 13:20:33 UTC
(
hide
)
Description:
BUG 12027: Added shibboleth authentication to the staff client
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2017-04-21 13:20:33 UTC
Size:
4.17 KB
patch
obsolete
>From f62e25282e2f951327cd6454e7256b372d0f8d11 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 31 Jul 2014 06:21:55 +0000 >Subject: [PATCH] BUG 12027: Added shibboleth authentication to the staff > client > >- This patch adds shibboleth authentication to the staff client. >- Depending upon how your url structure works, you may or may not need a > second native shibboleth service provider profile configured for this > to work. > >http://bugs.koha-community.org/show_bug.cgi?id=12026 >--- > C4/Auth.pm | 8 +++----- > C4/Auth_with_shibboleth.pm | 23 ++++++++++++++++++----- > koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 8 ++++++++ > 3 files changed, 29 insertions(+), 10 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index a139bce..fe5944a 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -850,9 +850,7 @@ sub checkauth { > } > > # If we are in a shibboleth session (shibboleth is enabled, a shibboleth match attribute is set and matches koha matchpoint) >- if ( $shib and $shib_login and $shibSuccess and $type eq 'opac' ) { >- >- # (Note: $type eq 'opac' condition should be removed when shibboleth authentication for intranet will be implemented) >+ if ( $shib and $shib_login and $shibSuccess) { > logout_shib($query); > } > } >@@ -936,8 +934,8 @@ sub checkauth { > > my ( $return, $cardnumber ); > >- # If shib is enabled and we have a shib login, does the login match a valid koha user >- if ( $shib && $shib_login && $type eq 'opac' ) { >+ # If shib is enabled and we have a shib login, does the login match a valid koha user >+ if ( $shib && $shib_login ) { > my $retuserid; > > # Do not pass password here, else shib will not be checked in checkpw. >diff --git a/C4/Auth_with_shibboleth.pm b/C4/Auth_with_shibboleth.pm >index 6b20511..456feda 100644 >--- a/C4/Auth_with_shibboleth.pm >+++ b/C4/Auth_with_shibboleth.pm >@@ -49,6 +49,7 @@ sub shib_ok { > return 0; > } > >+ > # Logout from Shibboleth > sub logout_shib { > my ($query) = @_; >@@ -131,21 +132,33 @@ sub _autocreate { > sub _get_uri { > > my $protocol = "https://"; >+ my $interface = C4::Context->interface; >+ $debug and warn "shibboleth interface: " . $interface; >+ >+ my $return; >+ my $uri; >+ if ( $interface eq 'intranet' ) { > >- my $uri = C4::Context->preference('OPACBaseURL') // ''; >- if ($uri eq '') { >- $debug and warn 'OPACBaseURL not set!'; >+ $uri = C4::Context->preference('staffClientBaseURL') // ''; >+ if ($uri eq '') { >+ $debug and warn 'staffClientBaseURL not set!'; >+ } >+ } else { >+ $uri = C4::Context->preference('OPACBaseURL') // ''; >+ if ($uri eq '') { >+ $debug and warn 'OPACBaseURL not set!'; >+ } > } >+ > if ($uri =~ /(.*):\/\/(.*)/) { > my $oldprotocol = $1; > if ($oldprotocol ne 'https') { > $debug > and warn >- 'Shibboleth requires OPACBaseURL to use the https protocol!'; >+ 'Shibboleth requires OPACBaseURL/staffClientBaseURL to use the https protocol!'; > } > $uri = $2; > } >- > my $return = $protocol . $uri; > return $return; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >index c6a050c..a2c6645 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >@@ -41,6 +41,14 @@ > <div id="login_error"><strong>Error: </strong>Invalid username or password</div> > [% END %] > >+[% IF (shibbolethAuthentication) %] >+<!-- This is what is displayed if shib login has failed --> >+[% IF (invalidShibLogin ) %] >+<div id="login_error"><Strong>Error: </strong>Shibboleth login failed</div> >+[% END %] >+<p>If you have a shibboleth account, please <a href="[% shibbolethLoginUrl %]">click here</a> to login.</p> >+[% END %] >+ > <!-- login prompt time--> > <form action="[% script_name %]" method="post" name="loginform" id="loginform"> > <input type="hidden" name="koha_login_context" value="intranet" /> >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12026
:
26769
|
26788
|
28408
|
30351
|
30352
|
30376
|
31054
|
31055
|
35551
|
35552
|
56241
|
56242
|
56243
|
57486
|
57563
|
57564
|
57565
|
57566
|
61268
|
61269
|
61270
|
61271
|
61363
|
61364
|
61365
|
61366
|
61367
|
61435
|
61436
|
61437
|
61438
|
61444
|
61445
|
61446
|
61447
|
61448
|
61449
|
61521
|
61522
|
61523
|
61524
|
61525
|
61526
|
61527
|
61596
|
61598
|
61599
|
61675
|
61676
|
61677
|
61678
|
61679
|
61680
|
61683
|
61684
|
62521
|
62522