]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1710949 open-ils.auth.login API
authorBill Erickson <berickxx@gmail.com>
Tue, 15 Aug 2017 17:13:03 +0000 (13:13 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 1 Sep 2017 17:05:32 +0000 (13:05 -0400)
commit18b313d5c933a43dc02ced2ab035197797ea36b3
tree782b1306d42a8d4047c36283717d1745668662f8
parentb437f50243e90b63dd3ba6f9532448df8c601a5f
LP#1710949 open-ils.auth.login API

Adds a new open-ils.auth API call 'open-ils.auth.login' which performs
the combined steps of open-ils.auth.authenticate.init and
open-ils.auth.authenticate.complete so the caller only need call one API
to login.

API params are consistent with open-ils.auth.authenticate.complete with
2 notable excpetions.  The API uses the bare password instead of the
hashed password, so the caller also need not perform the extra hashing
steps.  Also, no 'nonce' parameter is used as it's no longer needed,
because there is no intermediate authentication cache object as with
.init.

Response data is consistent with open-ils.auth.authenticate.complete.

Example:

srfsh# request open-ils.auth open-ils.auth.login {"username":"admin","password":"fakepassword"}

Other changes in the new code:

1. Using the generic "identifier" parameter in combination with the
   "org" parameter allows the API to reliably determine if a value
   is a username or barcode.

2. Once a caller has reached the configured maximum number of login
   failures, no further attempts to track failures occurs, based on the
   idea that no additional cpu/network cycles should be used on a lost
   cause.

3. A failure count object is only added to memcache when failures
   occur, unlike open-ils.auth.authenticate.init which creates a
   failure tracking object for every login.

4. The code avoids use of the jsonParseFmt() and va_list_to_string()
   functions as these functions require extra data cleansing.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/c-apps/oils_auth.c