Bugzilla – Attachment 61516 Details for
Bug 18144
Removal of persona broke Google OAuth2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 18144: Restore pieces of C4/Auth to make Google OpenID Connect work
SIGNED-OFF-Bug-18144-Restore-pieces-of-C4Auth-to-m.patch (text/plain), 2.83 KB, created by
Josef Moravec
on 2017-03-23 09:10:47 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 18144: Restore pieces of C4/Auth to make Google OpenID Connect work
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-03-23 09:10:47 UTC
Size:
2.83 KB
patch
obsolete
>From 29bb86cfc4bf26bb85c080b863f307a8d3feea9e Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Mon, 20 Feb 2017 01:37:49 -0500 >Subject: [PATCH] [SIGNED-OFF] Bug 18144: Restore pieces of C4/Auth to make > Google OpenID Connect work > >By restoring some pieces of logic, with the name changed from $persona >to $emailaddress, the openid will work again for OPAC logins. > >See https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10988#c68 >for an excellent test plan. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/Auth.pm | 27 ++++++++++++++++++++++++++- > 1 file changed, 26 insertions(+), 1 deletion(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 5dcf1cd..2b81170 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -746,6 +746,7 @@ sub checkauth { > my $authnotrequired = shift; > my $flagsrequired = shift; > my $type = shift; >+ my $emailaddress = shift; > $type = 'opac' unless $type; > > my $dbh = C4::Context->dbh; >@@ -786,6 +787,9 @@ sub checkauth { > ); > $loggedin = 1; > } >+ elsif ( $emailaddress) { >+ # the Google OpenID Connect passes an email address >+ } > elsif ( $sessionID = $query->cookie("CGISESSID") ) > { # assignment, not comparison > my $session = get_session($sessionID); >@@ -922,7 +926,8 @@ sub checkauth { > if ( ( $cas && $query->param('ticket') ) > || $q_userid > || ( $shib && $shib_login ) >- || $pki_field ne 'None' ) >+ || $pki_field ne 'None' >+ || $emailaddress ) > { > my $password = $query->param('password'); > my $shibSuccess = 0; >@@ -950,6 +955,26 @@ sub checkauth { > $info{'invalidCasLogin'} = 1 unless ($return); > } > >+ elsif ( $emailaddress ) { >+ my $value = $emailaddress; >+ >+ # If we're looking up the email, there's a chance that the person >+ # doesn't have a userid. So if there is none, we pass along the >+ # borrower number, and the bits of code that need to know the user >+ # ID will have to be smart enough to handle that. >+ require C4::Members; >+ my @users_info = C4::Members::GetBorrowersWithEmail($value); >+ if (@users_info) { >+ >+ # First the userid, then the borrowernum >+ $value = $users_info[0][1] || $users_info[0][0]; >+ } else { >+ undef $value; >+ } >+ $return = $value ? 1 : 0; >+ $userid = $value; >+ } >+ > elsif ( > ( $pki_field eq 'Common Name' && $ENV{'SSL_CLIENT_S_DN_CN'} ) > || ( $pki_field eq 'emailAddress' >-- >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 18144
:
60447
|
61516
|
61589