@@ -, +, @@ 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. --- C4/Auth.pm | 8 +++----- C4/Auth_with_shibboleth.pm | 13 +++++++++++-- koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 8 ++++++++ 3 files changed, 22 insertions(+), 7 deletions(-) --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -800,9 +800,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); } } @@ -887,8 +885,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. --- a/C4/Auth_with_shibboleth.pm +++ a/C4/Auth_with_shibboleth.pm @@ -49,6 +49,7 @@ sub shib_ok { return 0; } + # Logout from Shibboleth sub logout_shib { my ($query) = @_; @@ -116,9 +117,17 @@ sub checkpw_shib { sub _get_uri { my $protocol = "https://"; + my $interface = C4::Context->interface; + $debug and warn "shibboleth interface: " . $interface; - my $return = $protocol . C4::Context->preference('OPACBaseURL'); - return $return; + my $return; + if ( $interface eq 'intranet' ) { + $return = $protocol . C4::Context->preference('staffClientBaseURL'); + return $return; + } else { + $return = $protocol . C4::Context->preference('OPACBaseURL'); + return $return; + } } sub _get_shib_config { --- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt @@ -42,6 +42,14 @@
If you have a shibboleth account, please click here to login.
+[% END %] +