https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36928

Victor Grousset/tuxayo <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #167097|0                           |1
        is obsolete|                            |

--- Comment #12 from Victor Grousset/tuxayo <[email protected]> ---
Created attachment 167202
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=167202&action=edit
Bug 36928: Patron authentication / password validation will fail with 500 error
for local users if external auth (LDAP/CAS/Shibboleth) is enabled

If external auth ( such as LDAP ) is enabled, and use of
/api/v1/auth/password/validation will fail with a 500 internal server error
like:
Can't call method "cardnumber" on an undefined value at
/usr/share/koha/lib/Koha/REST/V1/Auth/Password.pm line 83, <DATA> line 1490.

This is because the valid patron object is being overwritten with an undefined
value if there is no LDAP patron returned. Since a failed LDAP query falls back
to local user auth, we try to use the now undefined patron object thus
generating an error.

Test Plan:
1) Set up and enable LDAP
  https://wiki.koha-community.org/wiki/Ldap_testing
  (restart plack)
2) POST JSON to /api/v1/auth/password/validation like:
{
    "userid": "koha",
    "password": "koha"
}
Or run: prove t/db_dependent/api/v1/password_validation.t
3) Note the 500 error(s)
4) Apply this patch
5) Restart all the things!
6) POST the data again or run the tests
7) It works!

Signed-off-by: Victor Grousset/tuxayo <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to